Tuesday, September 14, 2010

How to write linux iso to usb

Universal-USB-Installer-1.7.9.6.exe

Wednesday, August 25, 2010

iPhone + iPad notes

1. Favourite game: Enigmo
2. Plants vs Zombies
3. Zynga Poker

Monday, June 21, 2010

How to extract a iso file

7z

Sunday, May 2, 2010

Install eclipse plug-in

Install plugin for eclipse
1. Find the URL of the plug-in (google)
2. Help --> Software Updates --> Add site button --> Paste URL
3. Select the plugin by checking the checkbox and then click Install

How to run a java main()

Saturday, March 27, 2010

Design icons for the application

If you want to design/copy icons for you application, use following tools:
- IcoFX: extract icons from resource/files of others application. They can be saved in .icon as well as image format.
- IconsExtractor: Use to search though the whole system to find icons and save to hard disk in .ico format.

Sunday, February 7, 2010

Oracle Administration

1. Create new schema
a. Open command prompt, change to C:\oracle\product\10.2.0\db_1\BIN>
b. set ORACLE_SID=cms
c. sqlplus / as sysdba;
d. create user identified by ;
e. grant create session, connect, resource to emp_role, mgr_role;
f. Use sqldeveloper to connect to the schema to create table/view/store...

Saturday, January 23, 2010

MySQL

C:\mysql\bin>mysqld --install install mysql server
C:\mysql\bin>mysqld --remove uninstall mysql server
start mysql open windows services and start mysql
C:\mysql\bin>mysql Invoke mysql client
C:\mysql\bin>mysql -u root login to local mysql as root (default password is blank)
select version(), user();Check mysql version, current user
show databases; Show all databases
use New_DB_Name;Chang DB
CREATE USER 'user1'@'localhost' IDENTIFIED BY 'pass1';
grant all privileges on joomla.* to 'joomla'@'localhost';
CREATE DATABASE sonlmdb; create new db
mysql>use sonlmdb; select database
show tables;Show tables
describe tablename;show table's structure
connect to mysql by sqldeveloper
connect to mysql by using MySQL Query Browser
Create a new table: open MySQL Query Browser --> right click to the schema --> create new table
Execute scripts: connect by using sqldeveloper
show create table table_name\Gcreate table script
Generate schema's script: MySQL UI -> MySQL Administrator -> Backup

Monday, January 18, 2010

Character set vs. character encoding

(copied from http://www.grauw.nl/blog/entry/254)
Recently I was asked to explain the difference between character encoding and character set, and I thought it would be interesting to write about this over here as well.

In these two terms, ‘set’ refers to the set of characters and their numbers (code points), and ‘encoding’ refers to the representation of these code points. For example, Unicode is a character set, and UTF-8 and UTF-16 are different character encodings of Unicode.

To illustrate this difference, in the Unicode character set, the € character has code point 8364 (usually written as U+20AC, in hexadecimal notation). Using the UTF-16LE character encoding this is stored as AC 20, while UTF-16BE stores this as 20 AC, and the UTF-8 representation is E2 82 AC.

In practice however, the two terms are used interchangeably. The difference as described above is not applicable to most non-Unicode character sets (such as Latin-1 and SJIS) because their code points are the same as their encoding. Because of that, there has never been a real distinction from a historical perspective.

The most important difference in English is that the term character set is a little old fashioned, and character encoding is most commonly used nowadays. The reason for this is likely that it is more correct to speak of character encoding when UTF-8 and UTF-16 are different possible encodings.

Some examples:

* The HTTP protocol uses
Content-Type: text/html; charset=UTF-8
* The more recent XML uses
<?xml version="1.0" encoding="UTF-8"?>

This illustrates how they are used synonymously. Both describe the character encoding of the content that follows.

Saturday, January 2, 2010

vi useful shortcut keys

dw delete a word
d$ delete to end of line
D delete to end of line
w move to next word (start)
e move to next word (end)
5w move 5 words and place cursor at first
5e move 4 words and place cursor at end
0 move to start of line
d5w delete 5 words
5dd delete 5 lines
Ctrl+R redo
ce change to end of word
c5e change 5 words
c$ change to end of line
C change to end of line
ctrl+G location in the file
gg move to start of file
% find matching ()[]
:! execute external command
v start select (virtual mode)
V start select whole line (virtual mode)
ctrl+v select rectangle
:w f write selection to file f
Y or yy copy current line
y copy the selection
d delete the selection
:r f insert text from f to this file
:r !ls put the ls output to current line
o open line below cursor
y5w yank 5 words
:set is set incrimental search
:help help
: ctrl+D possible completions
fa move to first 'a' character
ta move to before first 'a' character
dfa delete until the first 'a' character
cc clear current line and enter insert mode
S clear current line and enter insert mode
ma bookmark 'a' for the position
'a go to bookmark 'a'
'. go to last modification
HML jump to top/middle/last line of the screen
J join current lines
~ toggle case
* find the word under cursor.
. repeat last changing.
--jump-target position target line on line num of screen.