Warning  on use of the 'subtable' keyword

I have previously given advice on this list about the use of the "subtable" keyword which could lead to kern pairs being unavailable. If you have used this keyword, please review the following.
Background.
Class pairs in a kern feature are compiled as a lookup with a single subtable. The representation of the class pairs for a subtable looks like a big Excel spreadsheet, with all the left side pairs as the titles of the rows, and all the right-side pairs as the titles of the columns, and the kern pair values in the fields. As a result, every left side pair you name is kerned against every right side pair you name. Obviously, most of the fields are 0; there are non-zero values only where you specified a class pair kern value. Less obviously, all glyphs not named in a right side class are automatically assigned to right side class 0. This means that every left side class in the subtable is kerned against every glyph in the font ( with most of the kern values being 0).
If you have a lot of left and right side class pairs, this subtable can get so large some of the offset values in the compiled lookup exceed the limit of 64K, and the lookup can't be built. The 'subtable' keyword is provided to help with this problem. It forces the class pair lookup to start a new subtable at the point where you put the 'subtable' keyword. If you have any degree of order in your class kern pair definitions, each of the subtables will then have fewer left and right classes, and the overall size of the lookup is smaller.
My advice on using this keyword is:
a) use it only if you have to because of a size oveflow problem, and
b) there is not much use in trying to be smart about where you put it; it is usually simplest to put the first keyword more or less in the middle of the list of the class kern pairs. If this does not shrink the kern lookup enough, then put another 'subtable' keyword in the middle of each half of the class kern pair list, and so on.
However, I omitted an important warning:
c) any left side class can be used only within a single subtable.
This is because each left side class in a subtable is by definition kerned against every right side class, and hence every glyph in the font because of class 0. It follows that a program looking for a kern pair will never look past the first subtable with a left side class containing the left side glyph. Moral: any left side class can be used only within a single subtable. If you put kern class pairs with that left side class in a subsequent subtable ( e.g; after a subtable break), those kern class pairs will never be seen by any program.
My thanks to Karsten Luecke, whose struggle with an exanple of this problem showed that my previous advice on this list was incomplete.

You say you're extending JTable but I see no hint of that.
public class SpecialisedJTable extends JTable
    public SpecialisedJTable(TableModel model)
        super(model);
    public SpecialisedJTable()
        super();
}

Similar Messages

  • Improper use of the super keyword?

    Hi guys,
    I'd appreciate some help on this... I'm extending JTable but i'm getting an error on the overloaded super call... Here;s the simple code:
    import javax.swing.JTable;
    import javax.swing.table.TableModel;
    public class SpecialisedJTable
        public SpecialisedJTable(TableModel model)
            super(model);
        public SpecialisedJTable()
            super();
    }And this is the error message i get:
    ucl/webmodel/gui/SpecialisedJTable.java [12:1] Object() in java.lang.Object cannot be applied to (javax.swing.table.TableModel)
    super(model);
    ^
    1 error
    Errors compiling SpecialisedJTable.
    Any ideas why the error is being generated? Thanks...

    You say you're extending JTable but I see no hint of that.
    public class SpecialisedJTable extends JTable
        public SpecialisedJTable(TableModel model)
            super(model);
        public SpecialisedJTable()
            super();
    }

  • Shoukd the 'final' keyword should be used on all input parameters?

    In my very limited experience as a java programmer have never seen this done any where. Except in the java.lang.Math class which has a final variable, of type double, called PI. As pi is not a value that should change during the execution of a program, though this is not passed in as a parameter.
    However, on a new project, a co-worker is proposing the use of the 'final' keyword on all input parameters as a standard. He has about 5 years experience of maintaining java systems and is putting this suggestion forward as in the past people have overwritten values passed in as parameters causing confusion. Personally I don't see why this is such a major issue if one reads the code of the called programs.
    I would be grateful if anyone has seen this done before, or has any views on the advantages or disadvantages of this.
    Thanks in advance,
    LS

    Lord_Sidcup wrote:
    In my very limited experience as a java programmer have never seen this done any where. Except in the java.lang.Math class which has a final variable, of type double, called PI. As pi is not a value that should change during the execution of a program, though this is not passed in as a parameter.
    I'm sorry, but this point is irrelevant. There are lots of final fields (but not that many final parameters) in Java, BTW. Every field you declare in an interface is automatically final, for example.
    However, on a new project, a co-worker is proposing the use of the 'final' keyword on all input parameters as a standard. He has about 5 years experience of maintaining java systems and is putting this suggestion forward as in the past people have overwritten values passed in as parameters causing confusion. Personally I don't see why this is such a major issue if one reads the code of the called programs.
    IMHO, it's definately not a major issue. It is simply being restrictive, to be restrictive. The guy may have "five years experience", but he sounds lazy, to me. Besides, the first thing I would do in that case (if final were the default), would be something like this:
    public void myMethod (final String a, final int b) {
      String myA = a;
      String myB = b;
    }And now, what has he won by making it final? It simply added some up front work for some people, with no real added value. Also, if I had to retroactively change my code, I would change it as follows:
    //Original Code
    public void myMethod (String myA, int myB) {
      String myA = a;
      String myB = b;
    // New code
    public void myMethod (final String a, final int b) {
      String myA = a;
      String myB = b;
    }That way, you wouldn't even have to worry about changing anything else about your method, as the variables actually used in the rest of the body will remain the same.
    I would be grateful if anyone has seen this done before, or has any views on the advantages or disadvantages of this.The only thing declaring the parameter final does, is it prevents you from assigning a new value to the variable. The instance that parameter references (as long as it is not immutable to begin with) can still be manipulated. I.E. except in some very narrow, and specific, cases, no value added, simply a restriction that exists to be restrictive.
    >
    Thanks in advance,
    LSEdit: And man, am I slow and long-winded.

  • Using the 'this' keyword

    What is the use of the this keyword:
    import java.util.*;
    public abstract class LegalEntity implements HasAddress{
    private String address;
    private String area;
    private String registrationDate;
    private ArrayList accounts;
    public LegalEntity()
         accounts = new ArrayList();
    public void addAddress(String address){this.address = address;}
    public String getAddress(){return address;}
    public void addAccount(Account account)
         accounts.add(account);
    public ArrayList returnAccounts()
         return accounts;
    }

    This can be used when there are lots of static functions and you want to be sure you are invoking the current objects methods/members.

  • Querstion regarding the "this" keyword

    hi everyone,
    i've doubt regarding the usage of this keyword in the inner classes & static methods. like the following:
    class A {
        int val1 = 0;
        int val2 = 0;
        A() {
            B b = new B();
            C c = new C();
            for(int i=1; i < 11; i++) {
                b.add(i);
                c.add(i);
                System.out.println("Val 1 : " + val1);
                System.out.println("Val 2 : " + val2);
        public static void main(String args[]) {
            new A();
        class B {
            public void add(int val) {
                // the this keyword is used as static variable
                A.this.val1 += val;
        static class C {
            public void add(int val) {
                // the "this" keyword cannot be used
                //A.this.val2 += val;
    }the code doesn't matter what its meant for, i wrote code to explain u my doubt with example.
    so any explanation from ur side, i'm not clear with the this keyword usage.
    thanx

    I am in agreement with trinta, although I think your doubt arises from a lack of understanding of inner classes, not from the use of 'this'. You seem very adept in the use of 'this'.
    Realise that there are 4 categories of nested classes:
    1> Top-level or static nested classes
    These are declared by the static keyword (as in class C in your example). They can be instantiated with or without an instance of the containing class. i.e. using the class names from your example.
    C c = new A.C();
    or
    C c = new instanceOfA.C();
    Since a static nested class does not require an instance of a class, there is no use of the 'this' keyword. There may not be any instance created, if if there was, which one since you don't have to specify which when creating it (see first example code above).
    2> Member Inner Classes
    As in class B in your example. The name should indicate that we think about these classes as members, or part of, the containing instance. Use these classes when it makes no sense for the inner class to exist outside the containing class. Usually these inner classes are designed to be helper classes and often hidden from view. When they aren't, the only way to create new instances of them is through an actual instance of the containing class. i.e. using the class names from your example,
    B b = new instanceOfA.B();
    Note that this code
    B b = new A.B();
    will yield an error. There must be an associated containing class.
    For this reason, the use of 'this' is only appropriate for member classes.
    3> Local Inner Classes
    4> Anonymous Inner Classes
    Not really relevant to this question.

  • A warning about using a tv with the mini

    My father is trying to use his new Mac Mini with his TV, using the video adaptor to plug into the s-video on his TV. Two problems cropped up; he wanted to learn to use a computer so I bought him Linda.com "intro to the Macintosh" DVD's. He couldn't get a video image with the lesson, though he could hear the audio. I called Linda.com and they said the resolution had to be 1024 (not the resolution that was coming out of the Mini). I had my Dad change the resolution, and he lost the signal from the computer (the video slipped out of sync) and got diagonal lines across his TV. Nothing we could do would bring back the signal so he took it to Fry's today. They traced the problem to the Mini resetting itself to 50 hz rather than 60 (Pal vs. NTSC?) upon the resolution being changed.
    They got it set back and advise he not change the resolution. So, be warned, if you use the Mini with a TV, be careful about the above situation. I think Apple should warn new buyers, like my Dad who want their TV to be used for the computer, since Apple is advertising the Mini as something you can plug into a TV.
    Also, if you, like my Dad, want to get the biggest text you can on the screen, don't change the resolution to the lowest, simply go to system preferences and go to Universal Access and scale up the text to what ever size you need, so much better. Thank you OSX and Tiger.
    Good luck,
    Lory
    I hope this solves some similar problems I've seen here.

    Just to correct a few misconceptions.
    1. Regular analogue TVs don't have a fixed horizontal "resolution" - they have a fixed number of lines per field and a fixed number of fields per second. Interlacing is used to combine two fields into a single frame. Analogue TV is not based around pixels or samples - so the horizontal resolution is not fixed. However there is a typical maximum resolution that can be carried - and these days broadcast TV is produced using digital standards based around the analogue standards - and this factors this in.
    2. Not all of the total number of lines in an analogue TV system contain video information (some lines are used for synchronising information - and there needs to be time to allow the electron beam to return from the bottom to the top of the screen) To add to this there is an additional issue in that not all of the total number of lines containing video are typically displayed on a regular TV due
    3. There are two dominant analogue TV line and field standards.
    * 625 lines at 50 fields per second. This is used in Europe, Australasia, parts of South America, and large sections of the Middle East, Asia and the Far East. Both PAL and SECAM colour systems are used - in varying flavours.
    The 625/50 system contains 576 active lines of picture information, so is also often described as 576/50.
    If you consider 4:3 (i.e. regular shaped screens) then the square-pixel resolution that fits this is 768x576 - and square pixels are what computers usually like to deal with.
    In broadcast terms - both 4:3 and 16:9 image are based around a 702x576 non-square pixel resolution contained within a 720x576 digital structure. (720x576 is slightly wider than 4:3 or 16:9)
    * 525 lines at 60 fields per second. This is used in North America, Japan, Korea, parts of South America etc. It is widely used with NTSC colour systems - though Brazil uses a variant of PAL.
    The 525/60 system these days uses 480 lines of resolution (originally it used a few more - around 483) - so it is often described as 480/60.
    In square pixel terms a 480 line 4:3 image is 640x480 resolution (our old favourite!)
    In broadcast terms the 4:3 and 16:9 images are sampled within a non-square pixel 720x480 structure. I'm not clear whether the 4:3/16:9 is now based on a 480 or 483 or 486 line image - so not clear as to the exact frame that equates to the analogue 4:3 or 16:9 image.
    Sure TV Output hardware itself may scale a Mac or PC video output to 720x480 or 720x576 for output purposes - as these resolutions are typically what consumer electronics kit runs at. However to state that a TV itself runs at a fixed horizontal resolution isn't accurate - if the TV is analogue it just has a limit to its horizontal resolution - not a fixed value.

  • How to reference a class without using the new keyword

    I need to access some information from a class using the getter, but I don't want to use the new keyword because it will erase the information in the class. How can I reference the class without using the new keyword.
    ContactInfo c = new ContactInfo(); // problem is here because it erases the info in the class
    c.getFirstName();

    quedogf94 wrote:
    I need to access some information from a class using the getter, but I don't want to use the new keyword because it will erase the information in the class. How can I reference the class without using the new keyword.
    ContactInfo c = new ContactInfo(); // problem is here because it erases the info in the class
    c.getFirstName();No.
    Using new does not erase anything. There's nothing to erase. It's brand new. It creates a new instance, and whatever that constructor puts in there, is there. If you then change the contents of that instance, and you want to see them, you have to have maintained a reference to it somewhere, and access that instance's state through that reference.
    As already stated, you seem to be confused between class and instance, at the very least.
    Run this. Study the output carefully. Make sure you understand why you see what you do. Then, if you're still confused, try to rephrase your question in a way that makes some sense based on what you've observed.
    (And not that accessing a class (static) member through a reference, like foo1.getNumFoos() is syntactically legal, but is bad form, since it looks like you're accessing an instance (non-static) member. I do it here just for demonstration purposes.)
    public class Foo {
      private static int numFoos; // class variable
      private int x; // instance varaible
      public Foo(int x) {
        this.x = x;
        numFoos++;
      // class method
      public static int getNumFoos() {
        return numFoos;
      // instance method 
      public int getX() {
        return x;
      public static void main (String[] args) {
        System.out.println ("Foo.numFoos is " + Foo.getNumFoos ());
        System.out.println ();
        Foo foo1 = new Foo(42);
        System.out.println ("Foo.numFoos is " + Foo.getNumFoos ());
        System.out.println ("foo1.numFoos is " + foo1.getNumFoos ());
        System.out.println ("foo1.x is " + foo1.getX ());
        System.out.println ();
        Foo foo2 = new Foo(666);
        System.out.println ("Foo.numFoos is " + Foo.getNumFoos ());
        System.out.println ("foo1.numFoos is " + foo1.getNumFoos ());
        System.out.println ("foo1.x is " + foo1.getX ());
        System.out.println ("foo2.numFoos is " + foo2.getNumFoos ());
        System.out.println ("foo2.x is " + foo2.getX ());
        System.out.println ();
    }

  • TS1424 IOS 6 update completed.  Can't update apps now because I get warning stating "Your account is not valid for use in the Japanese store.  You must switch to the U.S. store before purchase."  How do I switch back?

    Ysterday I updated to the new IOS6 on my Iphone 4.  The phone service is provided by the Softbank carrier in Japan but I am an American and my Itunes account is U.S.  After the update I get this warning when trying to install app updates "Your account is not valid for use in the Japanese store.  You must switch to the U.S. store before purchase."  This is something that must have occured during the the IOS6 install so my question is how do I get my Iphone 4 to recognize the U.S. store again?

    Open the App Store and tap "featured", go down untill you see your Apple ID... enter there and tap "View Apple ID"... it should automatically ask you if you want to switch the store. Switch and thats all.

  • I used to give my photo's keywords. Most of the time I have several photo's for the same keyword and it was possible to select all those photo's and give them the keyword in one move. Since of few weeks I can't do that anymore and I find it very annoying.

    I used to give my photo's keywords. Most of the time I have several photo's for the same keyword and it was possible to select all those photo's and give them the keyword in one move. Since of few weeks I can't do that anymore and it's very annoying. What can I do to get back to the former situation?

    . Since of few weeks I can't do that anymore and it's very annoying. What can I do to get back to the former situation?
    Check, if you have the "Primary Only" option enabled. Then keywords will only be applied to the "Primary Image":
    See:                  Keywords or ratings are applied only to one of the selected images - why?
    Uncheck the little square button with the "1".

  • Using the LIKE keyword in a SQL query

    Does anyone have an example using the Database Connectivity Execute Query vi and the LIKE keyword? I would like to do something like:
    SELECT TestNum, TestType FROM tests WHERE DeviceType ='Paul_AF125_Ver1' AND DeviceID = 'Test1' AND (TestType LIKE "Cyclic Voltammetry*")
    It works fine if I say LIKE "Cyclic Voltammetry" (without the *) but if I put the * in there, I get no records.
    I'm using Microsofts SQL Server Desktop Engine (comes with Access).
    Thanks,
    Paul

    Paul-
    Thank you for contacting National Instruments. I don't have an example program, but I did find some information for you.
    LIKE - similar to.
    Using the LIKE command, you can use the wildcard symbol %. To find names starting with J : names LIKE 'J%'; Ending in s ? name LIKE '%S'; You can use more than one % charactor too : names LIKE '%sam%'; Also, LIKE is not case sensitive.
    What you have written, may work if you change the wildcard syntax from * to %.
    -Erik

  • Unable to publish in Swf format. Get error message: 'Swf compilation failed. Note: Please verify if any of the actionscript keywords is used as user variable name'. Anyone know how to fix?

    Unable to publish in Swf format. Get error message reads: 'Swf compilation failed. Note: Please verify if any of the actionscript keywords is used as user variable name'. Anyone know how to fix?

    Hi There,
    Can you tell me the Operating System and Captivate version you are using?
    Also can you confirm if you are getting this issue will this one project or all the projects? Try to copy paste this project on a new blank project and then try to publish.
    Regards,
    Mayank

  • What are the pros and cons of using people keywords, given that my catalogue is already uptodate with regular keywording of all subjects?  e.g., will the people keyword transfer to other programs?, can I use the same name for a people keyword and regular

    What are the pros and cons of using people keywords, given that my catalog is already up to date with regular keywording of all subjects?  e.g., will the people keyword transfer to other programs?, can I use the same name for a people keyword and regular keyword in the same photo?

    What are the pros and cons of using people keywords, given that my catalog is already up to date with regular keywording of all subjects?  e.g., will the people keyword transfer to other programs?, can I use the same name for a people keyword and regular keyword in the same photo?

  • In the process of reformatting my macbook pro, I saved everything but my keyword list.  The keywords are with the images, but the total list I use under "Keywords" is not present.  Is there a way to re-create all my keywords I've used over the last 6 year

    In the process of reformatting my macbook pro, I saved everything but my keyword list.  The keywords are with the images, but the total list I use under "Keywords" is not present.  Is there a way to re-create all my keywords I've used over the last 6 years.

    I accomplished what I needed last night.  I remembered I had picked my favorite images from each year and put them in a "favorite" folder by year.  These folders included 500 to 1200 images per year.  I pulled up the folder for each year and highlighted all images and clicked on "Keywords" and all keywords used for all images were listed.  I made those keywords persistent.  It took me a while to realize I had to click on each keyword to make it persistent.  After doing this for all years, I assume 95% of all keywords I have used over the many years were back in my list.  I'm sure there is probably a more "technical" way to accomplish what I needed, but this seems to have worked.  I also exported my list into a word document and is saved on my hard drive.
    If I had not made folders with my favorite images for each year, I could not have used this method, so if you figure out a better way, I like to hear it.  Thanks for your comments and willingness to help.

  • Which java keyword cannot be used inside the body of a static method?

    Which java keyword cannot be used inside the body of a static method, but may be used without problems in a non-static method?

    But javac doesn't complain. So I was not partially wrong -- I was completely wrong.It's still better not to use the "this", though. When you explictly reference a static member via an instance reference (theFoo.bar or this.bar, as opposed to Foo.bar) the JLS requires a check that the reference is non-null. Clearly "this" is always non-null, but javac still puts in half of the check. Take the simple class public class Test {
        static int field;
        public void setField(int i) {this.field=i;}
        public void staticSetField(int i) {field=i;}
    } and observe the bytecodes produced: $ javap -c Test
    Compiled from "Test.java"
    public class Test extends java.lang.Object{
    static int field;
    public Test();
      Code:
       0:   aload_0
       1:   invokespecial   #1; //Method java/lang/Object."<init>":()V
       4:   return
    public void setField(int);
      Code:
       0:   aload_0
       1:   pop
       2:   iload_1
       3:   putstatic       #2; //Field field:I
       6:   return
    public void staticSetField(int);
      Code:
       0:   iload_1
       1:   putstatic       #2; //Field field:I
       4:   return
    }The JIT will get rid of it, but you may as well avoid the waste in the first place. (And if you really do want to check that the reference is non-null, do the check explicitly so that maintainers know it's intentional).

  • When publishing a captivate I get the message "Swf compilation failed. Note: Please verify if any of the actionscript keywords is used as user variable name." and it won't allow me to publish the Captivate, can anyone help?

    When publishing a captivate I get the message "Swf compilation failed. Note: Please verify if any of the actionscript keywords is used as user variable name." and it won't allow me to publish the Captivate, can anyone help?

    Hi There,
    Can you tell me the Operating System and Captivate version you are using?
    Also can you confirm if you are getting this issue will this one project or all the projects? Try to copy paste this project on a new blank project and then try to publish.
    Regards,
    Mayank

Maybe you are looking for