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

Similar Messages

  • Q: new language features and JVM 1.4

    I just finished reading Joshua Bloch's article on new Java language feature and am looking forward to their introduction.
    Will programs compiled using the new features (generics, enhanced for, autoboxing, enums, static imports, and metadata) still run under a JVM 1.4?
    I understand that a program that uses new gizmos from Swing, etc. will NOT run, but how about these language features?
    Thanks, Ralph

    Objects you would like to use in the new for loop syntax must be >instances of the Iterable interface which will be added to the >java.lang package. The Collection interface will extend Iterable. This >will allow arbitrary type to be used in the new for loop without
    having to extends Collection. ah ok, why is this needed over doing plain syntactical transformations at compile-time e.g.
    for( o : myarray ){
    code
    goes to
    for(int i=0; i<myarray.length; i++){
    Object o = myarray<i>;
    code
    or
    for( o : myCollection ){
    code
    goes to
    for(Iterator i = myCollection.iterator(); i.hasNext(); ){
    Object o = i.next();
    code
    (I don't see why typing the element holder couldn't be automated too?)
    asjf

  • Variable scope local, pattern match compactly

    Hi,
    I read lines from a file and would like do something different with the line depending on whether it contains a single word or two words.
    var rxA:RegExp = /^\s*(\S+)\s+(\S+)\s*$/;
    var rxB:RegExp = /^\s*(\S+)\s*$/;
    str is the line I read from a file
    if( rxA.test(str) ){
        var match:Object = rxA.exec(str);
        do something with match[1] and match[2];
    if( rxB.test(str) ){
        var match:Object = rxB.exec(str);
        do something with match[1];
    With this code I get an error message, the object name "match" is used twice. Is it possible to make this variable local such that no other routine outside the "if" block can see this object?
    Is it possible to do not only the test, but the exec also inside the if( ... ), like this (similar to Perl):
    if( var match:Object = rxA.exec(str) ){
        do something with match[1] and match[2];
    Thanks,
    Illes

    Hi,
    Regading the first question, unfortunatelly "match" is function bound.
    You can however define it only once outside the two ifs, as in:
    var match:Object;
    if( rxA.test(str) ){
        match = rxA.exec(str);
        do something with match[1] and match[2];
    if( rxB.test(str) ){
        match = rxB.exec(str);
        do something with match[1];

  • Tutorials for the new language features

    Hello, I read several tutorials about generics&co.
    Some were good, some were bad.
    I think it is a good idea to have a place, where everybody can post the tutorials he knows.
    Which tutorials do you know?

    Gilad Bracha's Generics Tutorial:
    http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf
    William Grosso's Explorations mini-series:
    http://today.java.net/pub/a/today/2003/12/02/explorations.html
    http://today.java.net/pub/a/today/2004/01/15/wildcards.html
    The spec, plus related material (though not necessarily 'easy' to understand or up-to-date):
    http://java.sun.com/j2se/1.5.0/lang.html
    There was also a series on IBM's developerWorks called "Java generics without the pain" by Eric E. Allen, though I wouldn't recommend it if you're just trying to get your head around Java 1.5's generics. Not that it's a bad series, but it wanders off into other designs like NextGen, which could be confusing.
    As has been mentioned before, the collections framework's source code is a great resource, and there are other generic types lounging around in places like java.lang and java.util.concurrent.
    Mark

  • Syslog pattern match

    Hi Guys,
    I'm looking for a way to setup a syslog pattern match on everything except a particular string.
    So for example, I want to monitor the rate at which new logs appears in the local buffer with the exception of messages with %PARSER contained in them.
    I have the basics working but I'm having trouble finding a regex expression that will do this.
    Thanks in advance,
    Neil

    To match everything but a specific pattern you would likely need to use a zero length negative lookahead regular expressin pattern.  These have been supported in Tcl regexp since 8.1 and Cisco IOS provides Tcl 8.3.4 if I remember correctly.  So something along the lines of '^(?!PARSER).*'.  I don't believe the % is presented to EEM (but a debug could help prove that, I simply forget if it is actually) and I assume then that the string you would be comparing this to would then start with PARSER.  If not you could remove the ^ anchor.

  • 9@ Route Pattern Matched Issues

    Unfortunately I have to deal with a lot of 9@ route patterns in our deployment.  I understand weird things happen when 9@ is used, but even this one is boggling my mind.  So I was hoping someone could help me understand why it's doing what it's doing.
    I have a CSS with a collection of partitions.   I'll call the 3 I'm interested in the following: One-PT, Two-PT, Three-PT.
    One-PT has a route pattern of 9@ with the Local filter applied going to Gateway 1.
    Two-PT has a route pattern of 9@ with the Local filter applied going to Gateway 2.
    Three-PT has a route pattern of 9.XXXXXXXXXX with no filter applied (those are 10 Xs) going to Gateway 3.
    My phone is assigned to the CSS with these 3 partitions.  When I dial 9 981 xxx xxxx DNA says that 9@ from One-PT is always matched.  If I remove One-PT from the CSS, then 9@ in Two-PT is matched.  Only if I remove those 2 partitions does Three-PT get matched.
    Now, as I said above I understand 9@ can introduce weird routing issues, but I thought that the route pattern with 9 and 10 Xs would be more specific and it would be matched.  Obviously I was wrong, but I'm trying to understand why I was wrong. Is this because the 10 digit number dialed matches the NANP and the Local filter matches a NANP area code?  Thus it's the more exact match?
    Thanks!

    Hi,
    As per the following link
    http://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cucm/admin/5_0_4/ccmsys/ccmsys/a03rp.html#wp1050657
    "Using the @ Wildcard Character in Route Patterns
    Using the @ wildcard character in a route pattern provides a single route pattern to match all NANP numbers, and requires additional consideration.
    The number 92578912 matches both of the following route patterns: 9.@ and 9.XXXXXXX. Even though both these route patterns seem to equally match the address, the 9.@ route pattern actually provides the closest match. The @ wildcard character encompasses many different route patterns, and one of those route patterns is [2-9][02-9]XXXXX. Because the number 2578912 more closely matches [2-9][02-9]XXXXX than it does XXXXXXX, the 9.@ route pattern provides the closest match for routing."
    Also, check the following post
    https://supportforums.cisco.com/discussion/10698966/9-route-pattern
    HTH
    Manish

  • Regular Expressions (Pattern/Matcher) --- Help

    Hi,
    I have an regex i.e. Pattern.compile("([0-9])D([0-9])'?(?:([0-9]+)\")?([NSEW])").{code}
    It has to exactly match the input e.g *45D15'34"N*
    I need to retrieve the values based on grouping.
    Group1 = 45 (degree value)
    Group2 = 15 (minutes value)
    Group3 = 34 (seconds value) ----> this is a non-capturing group
    Group4 = N (directions)
    The regex works fine for most of longitude/latitude value but I get a StackOverFlow for some. There is a known bug on this http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5050507
    According to the bug report, they have said that are many different regex that can trigger the stack overflow....even though the length of my input is not as long as the one posted on the bug report.
    I was wondering if anyone could suggest a different way of writing the regex above to avoid the stack over flow.
    Thank you in advance                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Hi,
    I missed the '+' in my original regex Pattern.compile("([0-9]+)D([0-9]+)'?(?:([0-9]+)\")?([NSEW])"){code}.
    I have also tried {code} Pattern.compile("(\\d+)D(\\d+)'?(?:(\\d+)\")?([NSEW])");And, the other 2 expressions as suggested by you.
    The problem happens when Durham Lat=”35D52’N” Lon=”78D47’W value is selected from a Jtree(the values are parsed from a xml file to the tree - the xml file has a bout 800 longitude/latitude elements for different cities in the US). It does not happen for other values and If I increment the degree or min by, then the expression works. I am not sure how else i could re-write this exp.
    Below is the snippet of the xml file:
    <State name="NORTH CAROLINA">
                <City name="Asheville AP"     Lat="35D26'N"     Lon="82D32'W"/>
                <City name="Charlotte AP"     Lat="35D13'N"     Lon="80D56'W"/>
                <City name="Durham"     Lat="35D52'N"     Lon="78D47'W"/>
                <City name="Elizabeth City AP"     Lat="36D16'N"     Lon="76D11'W"/>
                <City name="Fayetteville, Pope AFB" Lat="35D10'N"     Lon="79D01'W"/>
                <City name="Goldsboro,Seymour-Johnson"     Lat="35D20'N"     Lon="77D58'W"/>
                <City name="Greensboro AP (S)"     Lat="36D05'N"     Lon="79D57'W"/>
                <City name="Greenville"     Lat="35D37'N"     Lon="77D25'W"/>
                <City name="Henderson"     Lat="36D22'N"     Lon="78D25'W"/>
                <City name="Hickory"     Lat="35D45'N"     Lon="81D23'W"/>
                <City name="Jacksonville"     Lat="34D50'N"     Lon="77D37'W"/>
                <City name="Lumberton"     Lat="34D37'N"     Lon="79D04'W"/>
                <City name="New Bern AP"     Lat="35D05'N"     Lon="77D03'W"/>
                <City name="Raleigh/Durham AP (S)"     Lat="35D52'N"     Lon="78D47'W"/>
                <City name="Rocky Mount"     Lat="35D58'N"     Lon="77D48'W"/>
                <City name="Wilmington AP"     Lat="34D16'N"     Lon="77D55'W"/>
                <City name="Winston-Salem AP"     Lat="36D08'N"     Lon="80D13'W"/>
            </State>
    public final class GeoLine {
        /* Enum for the possible directions of longitude and latitude*/
        public enum Direction {
            N, S, E, W;
            public boolean isLongitude() {
                return (this == E || this == W);
            public boolean isLatitude() {
                return (this == N || this == S);
            public Direction getCanonicalDirection() {
                if (this == S) {
                    return Direction.N;
                } else if (this == W) {
                    return Direction.E;
                } else {
                    return this;
        private final int degree;
        private final int minute;
        private final int second;
        private final Direction dir;
        /* Recognizes longitude and latitude values that has degrees, minutes and seconds i.e. "45D15'34"N
        * or "45D1534"N. The single-quotes for the minutes is optional. And, for the moment we do not support seconds
        * validation although ilog library returns the longitude/latitude with second when NEs and Sub-networks are
        * dragged and dropped on the map.*/
    private static final Pattern PATTERN = Pattern.compile("([0-9]+)D([0-9]+)'?(?:([0-9]+)\")?([NSEW])");
        public GeoLine(int degree, int minute, Direction dir) {
            this(degree, minute, 0, dir);
        public GeoLine(int degree, int minute, int second, Direction dir) {
            Log.logInfo(getClass().getSimpleName(), "PAU degree: " + degree + " minute: " + minute + " second: " + second + " direction: " +  dir);
            verifyLongitudeLatitude(degree, dir);
            verifyMinute(degree, minute, dir);   
            this.degree = degree;
            this.minute = minute;
            this.second = second;
            if (this.degree == 0 && this.minute == 0 && this.second == 0) {
                this.dir = dir.getCanonicalDirection();
            } else {
                this.dir = dir;
        public Direction getDirection() {
            return dir;
        public int getMinute() {
            return minute;
        public int getDegree() {
            return degree;
        public int getSecond() {
            return second;
        public static GeoLine parseLine(String location) {
            * Matcher class will throw java.lang.NullPointerException if a null location
            *  is passed, null location validation is not needed.
            Matcher m = PATTERN.matcher(location);
            if(m.matches()) {
                int deg;
                int min;
                int second;
                Direction direction;
                deg = Integer.parseInt(m.group(1));
                min = Integer.parseInt(m.group(2));
                if (m.group(3) == null) {
                    second = 0;
                } else {
                    second = Integer.parseInt(m.group(3));
                direction = Direction.valueOf(m.group(4));
                return new GeoLine(deg, min, second, direction);
            } else {
                throw new IllegalArgumentException("Invalid location value. Expected format XXDXX'XX\"[NSEW] " + location);
        private void verifyMinute(int deg, int min, Direction direction) {
            /* This validation is to make sure that minute does not exceed 0 if maximum value for latitude == 90
            * or longitude == 180 is specified */
            int maxDeg = direction.isLatitude() ? 90 : 180;
            if(min < 0 || min > 59) {
               throw new NumberFormatException("Minutes is out of range. Value should be less than 60: " + min);
            if (deg == maxDeg && min > 0) {
                throw new NumberFormatException("Degree value " + deg + "D" + direction + " cannot have minute exceeding 0: " + min);
        private void verifyLongitudeLatitude(int valDeg, Direction valDir) {
               int max = valDir.isLatitude() ? 90 : 180;
               if(valDeg < 0 || valDeg > max) {
                    throw new NumberFormatException("Degree " + valDeg + valDir + " is invalid");
        public final boolean isLongitude() {
            return dir.isLongitude();
        public final boolean isLatitude() {
            return dir.isLatitude();
        @Override
        public final String toString(){
            if(minute < 10){
                return degree + "D0" + minute + dir;
            } else {
                return degree + "D" + minute + dir;
        @Override
        public boolean equals(Object obj) {
            if (obj instanceof GeoLine) {
                GeoLine other = (GeoLine) obj;          
                    return (this.degree == other.degree && this.minute == other.minute && this.second == other.second && this.dir == other.dir);
            return false;
        @Override
        public int hashCode() {
            int result = 17;
            result = result * 37 + degree;
            result = result * 37 + minute;
            result = result * 37 + second;
            result = result * 37 + dir.hashCode();
            return result;
    }Thank you again.

  • Use of edge detection in pattern matching algorithm?

    Hello all,
                    I work for a group at Texas A&M University researching two-phase flow in reactors.  We have been using IMAQ Vision and had a question regarding the use of edge detection in the pattern matching algorithm.  I had seen the webcast entitled “Algorithms that Learn: The Sum and Substance of Pattern Matching and OCR” (http://zone.ni.com/wv/app/doc/p/id/wv-705) and in the webcast it was mentioned that the pattern matching algorithm uses edge detection to, (as best I can tell), reduce the candidate list further and to perform subpixel location calculations.  However, I was wondering if this edge detection process is still performed if we do not use the subpixel location calculation (i.e. if we uncheck the “Subpixel Accuracy” check box)?  Also, if edge detection is performed in the pattern matching algorithm is it consistent with the method described in Chapter 13 of the Vison Concepts Manual (“Geometric Matching”)?  Finally, if edge detection is performed in a manner consistent with Chapter 13 of the manual, how does the geometric matching correlation number affect the correlation calculation that was performed in the previous steps?  Are they simply multiplied together?
    Many thanks!
      -Aaron

    Jeff,
    We are using Imaq Vision Builder 4, with the included pattern matching that can be accessed via the menus (i.e. we haven't created a custom VI or anything.)  We are using the software to locate bubbles during boiling experiments and want a deeper understanding of what is going on "behind the scenes" of the algorithm, as we may have to explain how it works later.  We have been able to determine most of what we need from the webcast I had previously mentioned, except for the use of edge detection in the pattern matching algorithm.
    At the scales involved in our experiments, subpixel accuracy is really not needed and therefore we do not use it.  If edge detection is used in the pattern matching algorithm only to determine location with subpixel accuracy, then we do not really need to know how it works because we do not use that calculation.  Inversely, of course, if edge detection is used during pattern matching even without enabling subpixel accuracy, then we would like to have a fairly good understanding of the process.
    I've read most of the section on geometric matching in the Vision Concepts Manual and wondered if the process described there for edge detection (or feature matching) was also used in the basic pattern matching algorithm?
    To summarize, if edge detection is not used in the basic pattern matching algorithm without subpixel accuracy, then that is all I need to know.  If edge detection is used for pattern matching even without using the subpixel accuracy calculation, then we would like to learn more about how exactly it is used in the pattern matching algorithm.
    We would really appreciate any help you could give us... we've been digging around on the NI website for a couple of weeks now trying to fit together all the pieces of the pattern matching puzzle.
    Many thanks!
        Aaron

  • Can i add new language into my L1520?

    Question is simple, can i add a new language into my L1520 ? I bought it in Russia, and in options menu i just found several languages like spanish,english,french,Azerbaizhanish,even if chanise. But i need Turkish language. Can i download it somehow?
    Your help appraciated. Thanks in advance
    Currently using giant, amazing black Lumia 1520
    Solved!
    Go to Solution.

    If it's not listed in language+region settings, then you cannot download it, maybe that's why Nokia did not release it in Turkey yet  
    BTW, you would get the same answers from same person in your own language if you've visited local boards 
    The silence will fall

  • Other language features

    For these language features I should probably start a JSR, however, I want the opinion of the public for it.
    1) Language construct "alias"
    Many classes with different names do things which are nearly 100% the same. For example the Point and Dimension classes within the AWT framework. They collect the same data, only the name is different and the method names are different.
    It should be possible to make a simple base implementation of this and derive aliasses from this. This could look like:
    public class SomeClass { ... }which in another file could be aliased like:
    public class AnotherClass alias SomeClass;From the point of view of the point and dimension classes, the method names are also different, this could be solved by the following:
    public class SomeClass {
        public void someMethod() {}
    }which could be aliased like:
    public class AnotherClass alias SomeClass {
        anotherMethod alias someMethod // Keeping overloads correct
    }Note that an alias should be upcasted automatically but should manually be downcasted. With the addition of generics, it should give more room to decent notation.
    2) Language construct "range"
    Enumerations are very handy when dealing with logical named ranges such as dates and flags. However, if the range is numeric it is not possible to use a normal enum. There for my suggestion is the addition of the keyword range (a symboloc variant seems possible to me).
    A n example of constructing a range could be:
    public int range(20,30) somerange;Just as in the "alias" construct ranges should be upcasted automatically but should manually be downcasted.
    These two constructs are used in languages like C++, ADA and others, so it is not something which isn't used.

    This is going to be a large post, so hang tight!
    As the first reply talks about interfaces I give you partially credit, but that is not the reason why I suggested the "alias" key word.
    Suppose we have a highly simplified version of the Point and Dimension classes which these days look the following:
    // Point class
    public class Point {
        private int x = 0;
        private int y = 0;
        public void setLeft(int left) { x = left; }
        public void setTop(int top) { y = top; }
        public int getLeft() { return x; }
        public int getTop() { return y; }
    // Dimension class
    public class Dimension {
        private int x = 0;
        private int y = 0;
        public void setRight(int right) { x = right; }
        public void setBottom(int bottom) { y = bottom; }
        public int getRight() { return x; }
        public int getBottom() { return y; }
    }As you will notice, the classes core code is exactly the same. However, the methods in Both classes will fill memory. This could be eliminated when using the "alias" keyword. The following code represents my idea behind this.
    // Class representing the calculation logic of both Point as Dimension
    // It seems feasible to have a construct that the class should always have to be
    // used with an alias type, therefor, I typed "abstract alias".
    abstract alias class XY {
        private int x = 0;
        private int y = 0;
        public void setX(int x) { this.x = x; }
        public void setY(int y) { this.y = y; }
        public int getX() { return x; }
        public int getY() { return y; }
    // Point class, alias for  XY
    public class Point alias XY {
        setLeft alias setX;
        setTop alias setY;
        getLeft alias getX;
        getTop alias getY;
    // Dimension class
    public class Dimension alias XY {
        setRight alias setX;
        setBottom alias setY;
        getRight alias getX;
        getBottom alias getY;
    }I hope this will clear things up a little bit. These are only changes to the name of the method and the class, not to the implementation of it. They should become double references to the same methods.
    The second feature I suggested, the range feature would indeed be an infrigement to the compatibility to older classes which may use the range as a regular name. Here I will give a try again.
    int (20...30) limited;In this case a new primitive is created called limited, which is almost exactly the same as the int promitive, but can only store 20 through 30 to it. The following code demonstrates the idea behind it.
    int (20...30) limited;
    // use limited
    public void mainMethod() {
        limited foo = 25; // Compiles OK
        foo = 35; // Fails to compile
        int bar = foo; // Compiles OK
        foo = bar; // Fails to compile
        foo = (foo)bar; // Compiles ok, would throw a runtime exception when bar < 20 or > 30
    }I hope this demonstrates the usage.
    The suggestion about the "with" keyword is not really clear to me. Is it used to use bean-like methods as properties? If it is so, then you should know that this is already made possible using meta-attributes. If it is used to get rid of the notation of the variable, I would doubt if it improves readability, but hey, that is my opinion.
    Greetings,
    Sjoerd

  • USB SNAP + colour pattern matching ( IMAQ)

    I am new to LAbView and currently  I am working on colour pattern matching with USB snap. My problem is this program keep prompt me on the IMAQ Learn Colour Pattern. I need someone to help me solve that problem.
    Another question is 'Are colour pattern matching require us to save and load file before learn a template?'
    I am using LabView 7.1 and I would appreciate anyone who help me. Thanks
    Message Edited by Chee Hou on 09-16-2009 03:46 AM
    Attachments:
    Untitled.vi ‏189 KB

    Hello Chee Hou,
    Have you tried to run the example to do color pattern matching?
    From the example, you do need to have a template picture ready when you are using the colour pattern matching.
    You need to Learn Colour Pattern and then load the pattern to do color pattern matching.
    Hope this helps.
    James
    - Meadow -
    LabVIEW 7.0 - 2011, Vision, RT, FPGA
    TestStand 3.0 - 4.5

  • Add new language to Available Languages in Delegated Administrator

    Hi Sun!
    We've done a custom language to Convergence, but how can add this new language to the delegated administrator "Available Languages" option?
    Regards,
    bzg

    beck_zoltan wrote:
    We've done a custom language to Convergence, but how can add this new language to the delegated administrator "Available Languages" option?The following customization sets the available languages in the New User wizard to be "English" and "Magyar":
    a) Make the following change to /var/opt/sun/comms/da/da/jsp/users/newUser.xml:
    [root@server da]# diff newUser.xml newUser.xml.orig
    136,138c136,139
    <                 <option label="English" value="en" />
    <                 <option label="Magyar" value="hu" />
    <             </cc>
    <!-- <option label="newuser.wizard.preferredlanguage.en" value="newuser.wizard.preferredlanguage.en" />
    <option label="newuser.wizard.preferredlanguage.de" value="newuser.wizard.preferredlanguage.de" />
    <option label="newuser.wizard.preferredlanguage.pl" value="newuser.wizard.preferredlanguage.pl" />
    --> </cc>b) Add the following line to the bottom of /var/opt/sun/comms/da/da/WEB-INF/classes/com/sun/comm/da/resources/Resources.properties
    locale.hu=Magyarc) Redeploy Delegated Administrator (assumes you have deployed to Application Server 9.1/Glassfish 2.1)
    cd /opt/sun/comms/da/sbin
    ./config-appsvr8x-da deployRegards,
    Shane.

  • How can I load pattern matching images into memory?

    I discovered this problem by accident when our network went down. I could not run my VI because the .png file used for pattern matching was on a network drive. My concern it the amount of time that is required to read a network file. Is there a way to load the file into memory when the VI is opened?

    Brian,
    Thank you for contacting National Instruments. For most pattern matching programs, the pattern file should only be read from file once and is then copy to a buffer on the local machine. If you examine your code, or an example program for pattern matching, you should see at least two IMAQ Create VI called somewhere near the front of your code. This VI basically creates a memory location and most likely will be called once for your pattern image and once for the image you are searching.
    Unless you are specifically calling a File Dialog VI where you are given a dialog box to open a file or have hard coded the file path so that it is read each iteration of your code, then your pattern file should only need to be called at the beginning of your application, th
    us causing only one file read over the network for that image. Therefore your program most likely already loads the image in memory once it is read and should not be accessing the network constantly.
    Again, I would recommend taking a look at your code to make sure you are not causing a file access every time and then you should be ready to go. Just in case you do have the network go down, I would recommend keeping a copy of the image locally and, if you are feeling ambitious, you can programmatically have your program read the file locally if the network file returns an error.
    Good luck with your application and let us know if we can be of any further assistance.
    Regards,
    Michael
    Applications Engineer
    National Instruments

  • New reporting features

    hi,
    any new reporting features provided on XI 3.0 side?
    cheers

    Hi Pali,
    Please find the new features available in XI3.0
    1> Web Intelligence XI 3.0 introduces Smart Measures to delegate aggregation to the database.
    2> New querying functions are available in XI Release 3 are:
    a> Optional Prompt: Allows you to define a prompt as optional when building a query. The SQL generated for the query depends on how the report user responds or declines to respond to the prompt.
    b> The Explicit empty string: Allows the report user to retrieve rows that have an empty value with the explicit empty string in a list of values.
    c> Delegated LOV Search: Allows you to delegate the search for values in a LOV to the database. This feature prevents the LOV from being automatically loaded and the user from refreshing it. The user can perform a search for a pattern in the database. This feature restricts the data set returned and limits the load time to one acceptable to the user.
    For example, when using an optional prompt, you can prevent the LOV from loading automatically because you are not sure the report user wants to respond to the prompt. This can save the user some time.
    d> Percentage Rank: Enhances the existing u201CRanku201D query filter that bases the ranking on the top or the bottom of a given measure. The Percentage rank allows you to rank a percentage of the dimension volume, sliced (or not), on a second dimension.
    The ranking is performed at the database level and is database specific. This feature is only available in the Java Report Panel Query view.
    e> Query Sampling: Allows you to define random, seeded sampling in the query. The sampling is performed at the database and is database-specific.
    This is different from the maximum number of rows retrieved option at the microcube level.
    The formula functions can be divided into functions that allow Web Intelligence to close the gap with Desktop Intelligence, and formula enhancements.
    3> Functions that close the gap with Desktop Intelligence are:
    a> Forcemerge: When applied to a measure, this allows Web Intelligence to take into account for calculation merge dimensions even when they are not provided explicitly in the context of the calculation.
    Forcemerge is similar to the Desktop Intelligence Multi cube function. It provides Web Intelligence with a calculation capability for synchronized data equal to that of Desktop Intelligence.
    b> DataproviderType: Differentiates between personal data providers and universe data providers.
    It is similar to the DataproviderType function in Desktop Intelligence.
    BusinessObjects XI R3 Reference Guide: Web Intelligence
    c> Product: Returns the product of a group of numeric values. It is similar to the Product function in Desktop Intelligence.
    d> NoDrillfilter: Ignores a drill filter. It is similar to Nofilter in Desktop Intelligence.
    e> If-Then-Else syntax. It is similar to the If-Then-Else control structure in Desktop Intelligence.
    4> Formula enhancements include:
    a> UserResponse: Returns value index from data provider.
    b> IsPromptAnswered: Complements UserResponse for optional prompts.
    c> LastExectionDuration: Returns query duration.
    d> Mode: Returns most frequent value.
    e> ElseIF: Allows you to use simplified syntax which makes it easier to use.
    f> Where extensions: Handles new cases such as [Days]Where [Sales]>100
    g> ReportName: Returns the report name.
    h> RefValue: Returns the previous value when tracking data changes.
    Like the Smart Measure, these features improve query performance. The features use database-specific syntax to improve performance and allow for optimization on each vendoru2019s internal architecture
    Thanks,
    Madhu.

  • New Language Extensions in Sun Studio 12 C Compiler

    Sun Studio software engineer Dmitry Mikhailichenko gives an overview of some of the C-language extensions introduced in Sun Studio 12. Although some of these extensions are not part of the latest C99 standard, they are supported by the gcc compiler.
    The article also demonstrates how to use the new C features for creating generic macros with an example of linked-list manipulation-routines. Such macros semantically mimic C++ Standard Template Library, support arbitrary data types and provide strict compile-time type-checking.
    Read the entire article at http://developers.sun.com/solaris/articles/c_type.html and leave your comments in this forum entry. We'd like to know what you think about these extensions and if you have additional suggestions for the Sun Studio compiler team.

    Thank you for reporting the problem! I've submitted CR 6642662. It should be visible on web in a day or so.
    Boris

Maybe you are looking for

  • Bursting control file

    Hi all I wrote a bursting control file and I attached it to a data defention And I added the trigger to the rdf file but it is not working I need to know my mistake could you gave a look at it <?xml version="1.0" encoding="UTF-8" ?> - <xapi:requestse

  • Call function module in update task

    Hi I am using the follwoing logic in my prog CALL FUNCTION 'Z_Update _Task'    In update task   EXPORTING     t_vbak        =  t_vbak. But the program goes to dump at call function Please let me know if the syntax i am using is correct. Edited by: ki

  • I need some advanced help regarding AE and PPRO workflow

    Hi all. I have a problem and require a solution. I am creating a video that has cellphone/IM chat graphics, animated in After Effects. The problem is the layering. In PPRO, the layers are as follows on the timeline. Top layer: Chat Graphics Middle La

  • F4 help or List Box

    how to make our own F4 help. and. how to make a dropdown  list.

  • WebSphere 6.0 running error

    Hi, Thank you for reading my post. I've created an application inCreator 2 EA and was able to deploy and run it on WebSphere 6.0 remote servers. But when I run it gives me the following error. [05/11/22 17:49:07:718 JST] 00000039 ServletWrappe E SRVE