Wednesday, May 21, 2008

Java String to byte array and InputStream

Based on Google result, the best solutions are
byte[] byteArray = yourString.getBytes(charsetName);

InputStream stream = new ByteArrayInputStream(yourString.getBytes(charsetName));

Monday, May 19, 2008

Start trying Google App Engine

Just got a message from Google that my account was activated. A little anxious to start a journey of learning Python and doing experiments.

Sunday, May 18, 2008

Two font problems causing EPS cannot appear in LaTeX document

I am working on Windows XP, using Visio for drawing. My procedure to produce an EPS graphics is printing Visio page to PS -> PS to EPS using GSView. There are many other ways to get EPS out of Visio drawing. MetafileToEPSConverter is a good tool highly recommended, and remember to adjust its printing quality to higher than 600 dpi to get nice figures in PS file.

If you have adjusted your system DPI setup recently for your new big LCD, then you may find your old EPS files cannot be displayed correctly any more in a new PS file. The symptom is that the graphics just flashes and disappears, and leaves a blank space. The solution is just to change the DPI setup to the old value.

The other problem I encountered was that the font in EPS files looked weird and some characters were even missing. When embedded them in LaTeX documents, the graphics was simply not there. Later I figured out that that might caused by the Ghostscript, it was solved when I updated both GSview and Ghostscript to the latest versions.

Tuesday, May 13, 2008

Switch to blogger from MoveableType

I used to blog on Movable Type hosted by the University, but was a little disappointed after losing my long-typing several times. The first alternative blog host service I considered was WordPress, but I was surprised by they even charge for update the CSS of a template. I have registered already on blogger, and read many hosted by blogger in my reader. So I finally decided to move here. My old posts will still on MT for searching engines' sake until I have no access of the university service.