2011-12-05

Google ChromeFrame incompatible with Oracle Hyperion DRM

If you have installed the Google ChromeFrame add-on for Internet Explorer (MSIE) 7 or 8, you may find that you cannot login to Oracle Hyperion Data Relationship Management (DRM) 11.1.2.1. After MSIE loads the DRM login page, you may see some Javascript errors and when you press the Log on button, nothing happens.

Coincidentally, I started seeing this error message on another web site: ERROR: Possible problem with your *.gwt.xml module file. The compile time user.agent value(ie8) does not match the runtime user.agent value (safari). Expect errors. It seems that Google ChromeFrame add-on, which I installed to improve Javascript performance when I was using IE7, can send the wrong user-agent information to a server (even if the add-on is disabled). I have since upgraded to MSIE8, which is fast enough, so I no longer needed ChromeFrame and I uninstalled it.

Now, I can login to DRM and the GWT error messages no longer appear.

2011-12-02

Specify Rows or Columns for Excel AutoFit

If you use the Excel AutoFit Method to resize cells to display their contents nicely, remember to specify whether to AutoFit rows or columns in Excel, i.e. use Range().Columns.AutoFit or Range().Rows.AutoFit, not just Range().AutoFit. If you don't specify rows or columns, Excel produces Run-time error '1004': AutoFit method of Range class failed.

2011-11-26

Minimal JavaBean introspection example

Just playing with JavaBeans, so here's a small example to create a simple JavaBean, set a property and read it.

import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class SimpleBean {

  private final String name = "SimpleBean";
  private int size;
  public int getSize() {
    return size;
  }
  public void setSize(int size) {
    this.size = size;
  }
  public String getName() {
    return name;
  }
  
  public static void main(String[] args) throws IntrospectionException {
    SimpleBean sb = new SimpleBean();
    sb.setSize(59);
    BeanInfo bi = Introspector.getBeanInfo(sb.getClass());
    for (PropertyDescriptor pd : bi.getPropertyDescriptors()) {
      testGetValue(sb, pd);
    }
  }
  
  public static void testGetValue(Object sb, PropertyDescriptor pd) {
    System.out.print(pd.getName() + "=");
    Method getter = pd.getReadMethod();
    Object arg1[] = {};
    try {
      Object value = getter.invoke(sb, arg1);
      System.out.println(value);
    } catch (IllegalArgumentException e) {
      e.printStackTrace();
    } catch (IllegalAccessException e) {
      e.printStackTrace();
    } catch (InvocationTargetException e) {
      e.printStackTrace();
    }
  }
}

The output of the program is:

class=class SimpleBean
name=SimpleBean
size=59

2011-11-11

Grep -f: No blank lines

If you search for a list of patterns in a data file using grep like below, don't include a blank line in the pattern file otherwise grep prints the entire data file.

grep -f patterns.txt data.txt

It's as if you had typed:

grep "" data.txt

See GNU Grep Manual