code: public static String expand(String tmpl, String tn, int p, long gn, Date dt) {
          return expand(tmpl, tn, p, gn, dt, null);
      }
docs: Given a format string that may contain any of the following conversions
  <ul>
  <li>%t which is replaced with the provided table name</li>
  <li>%p which is replaced with the provided partition id</li>
  <li>%g which is replaced with the provided generation</li>
  <li>%d which is replaced with the provided date</li>
  </ul>
  A percent sign may be used to escape another
  
  Requires:
  - template
  - date (if %d is in the template)
  - table name
  - template contains %t and %p
  
  Use the given parameters and place them where their respective
  conversions are.
  
  @param tmpl format string
  @param tn table name
  @param p partition id
  @param gn generation
  @param dt date
  @return expanded string with the applied parameter substitution conversions