Sunday, December 4, 2011

OCE EJBD Study Books

Enterprise Java Beans 3.1
http://www.amazon.com/Enterprise-JavaBeans-3-1-Andrew-Rubinger/dp/0596158025

JSR 318: Enterprise JavaBeansTM 3.1
http://jcp.org/en/jsr/detail?id=318

Mock Exams from Enthuware


Ivan Krizsan's notes

OCE JSP&Servlet Study Books

Head First Servlets and JSP, 2nd Edition
Head First Servlets and JSP, 2nd Edition
Title: Head First Servlets and JSP, 2nd Edition
By: Bryan Basham, Kathy Sierra, Bert Bates
Publisher: O'Reilly Media
Formats: Print Ebook Safari Books Online
Print: March 2008
Ebook: June 2009
Pages: 912
Print ISBN:978-0-596-51668-0 | ISBN 10:0-596-51668-1
Ebook ISBN:978-0-596-55822-2 | ISBN 10:0-596-55822-8

It's for Java EE5 version


Servlet 3.0 specification
JSR 315: JavaTM Servlet 3.0 Specification
- New for Java EE6: Synchronous Servlet and Annotation
- Familiar with:  javax.servlet, javax.servlet.http, and javax.servlet.jsp Servlet, Filter, ServletContext, ServletConfig, GenericServlet, HttpServlet, ServletRequest, ServletResponse, etc


Mock Exams from Enthuware

Tuesday, September 20, 2011

yaml.dump() exception lead to corrupt data

A long .yml file. yaml.load() then edit then yaml.dump() to same file. If yaml.dump() throw exception, the original file might be corrupt.

Thursday, September 1, 2011

低级错误搞死了Eclipse

非常低级的错误,晕乎乎的午后所犯:
while (it.hasNext()) {
     size++;
}
程序一运行Eclipse就死了,系统也没有响应了。晕了半天才回过神:死循环。 遂改之:
while (it.hasNext()) {
     size++;
     it.next();
}
世界安静了。

Wednesday, August 10, 2011

Using console fonts in X

Just convert psf font to bdf font using gbdfed and put into your font directory

# sudo apt-get install gbdfed

then import a psf

Wednesday, May 18, 2011

Snow Leopard: Enable native NTFS read/write support Storage Devices

Snow Leopard(Mac OS X - 10.6.x) has the ability to mount NTFS volumes as read/write, but it's not enabled by default -- just read only is supported, as in 10.5. Here's how to get full read/write support for NTFS drives in Snow Leopard. First, uninstall NTFS-3G or Paragon if you're using either one.

Here's how to get read/write support for NTFS drives in Snow Leopard:

In Terminal, type diskutil info /Volumes/volume_name, where volume_name is the name of the NTFS volume. From the output, copy the Volume UUID value to the clipboard.
Back up /etc/fstab if you have it; it shouldn't be there in a default install.
Type sudo nano /etc/fstab.
In the editor, type UUID=, then paste the UUID number you copied from the clipboard. Type a Space, then type none ntfs rw. The final line should look like this: UUID=123-456-789 none ntfs rw, where 123-456-789 is the UUID you copied in the first step.
Repeat the above steps for any other NTFS drives/partitions you have.
Save the file and quit nano (Control-X, Y, Enter), then restart your system.

After rebooting, NTFS partitions should natively have read and write support. This works with both 32- and 64-bit kernels. Support is quite good and fast, and it even recognizes file attributes such as hidden files.

Tuesday, May 17, 2011

PuTTY connect to solaris 11 without color

Recently I connect solaris-x86 11 Express from PuTTY 0.60 but without displaying color in emacs 23.

Tried xterm/xtermc/xterm-color/xterm-256color/vt100/vt102/dtterm in configuration of PuTTY(No need to touch solaris side). Connection->Data->Terminal-type string, at last the "dtterm" is the correct one without bce(Back Color Earse) problem and works fine.

Monday, March 21, 2011

dbus/hal is not stable!

Recently I am writing some dbus/libhal programs to display mac address and some hard drive info. Programs run randomly away with this error:

libhal_ctx_init: org.freedesktop.DBus.Error.Disconnected: Connection was disconnected before a reply was received


It is totally unacceptable in this project. I need a stable solution. Just list some references here and write code to prove.

Hard Disk Metadata
The Linux /proc Filesystem as a Programmers' Tool

Sunday, March 13, 2011

Perl pack/unpack notes

Original post

'b' and 'B' formats


The 'b' and 'B' formats pack strings consisting of '0' and '1' characters to bytes and unpack bytes to strings of '0' and '1' characters. Perl treats even valued characters as 0 and odd valued characters as 1 while packing. The difference between the two is the order of the bits within each byte. With 'b', the bits are specified in increasing order. With 'B', in descending order. The count represents the number of bits to pack.

Examples

ord(pack('b8','00100110')) produces 100 (4 + 32 + 64)
ord(pack('B8','00100110')) produces 38 (32 + 4 + 2)

Here "Increasing Order" means from LSB to MSB, "Descending Order" means from MSB to LSB.

'h' and 'H' formats


The 'h' and 'H' formats pack strings containing hexadecimal digits. 'h' takes the low nybble first, 'H' takes the high nybble first. The count represents the number of nybbles to pack. In case you were wondering, a nybble is half a byte.

Examples

Each of the following returns a two byte scalar.
pack('h4','1234') produces 0x21,0x43
pack('H4','1234') produces 0x12,0x34