Wednesday, February 27, 2013

English sentences

Don't think too long about any statement- your gut reaction please.

输入法干扰AHK问题

某些软件文本中会自动触发中文输入法,测试AHK中Send会被干扰。解决方式
1.
http://www.appinn.com/a-motley-collection-of-ahk/
为英文输入法(或)设置一个快捷键,先切换输入法。WinXP自己可以设置,但我推荐“输入法设置工具”(下载:http://www.newhua.com/soft/37684.htm),这个也是我必备小工具,设置快捷键后,切换输入法相当方便。比如我将“中文简体——美式键盘”的快捷键设为Ctrl+6,最常用的中文输入法设为Ctrl+7,次常用的中文输入法设为Ctrl+8,这样设置比较科学。
2. 使用SendInput {S} instead of SendInput S
3. http://xuwei361.blog.163.com/blog/static/172883058201287115535985/

将字符串转化成对应的ascii码再进行输出就可以避免上述问题。
即将  send,cmd  改成  send,{ASC 99}{ASC 109}{ASC 100} 

Tuesday, February 19, 2013

Good statements


TD leader's don't skim the surface; they roll up their sleves and get involved in their business so they thoroughly understand it.
Get things done.
Focus on what matters.
Work effectively in Teams is about being able to get things done when you don't own all of the pieces that you need to accomplish your objective.
Speak candidly but with respect, not rounding corners.
Have no time for internal politics.
Surface problems, fix them and learn from them.
Actions speak lounder than words.

Sunday, February 17, 2013

When dinosaurs came with everything


hadrosaur   鸭嘴龙
triceratops 三角龙
stegosaurus 剑龙
ankylosaur  甲龙
duckbill    鸭嘴兽
velociraptor迅猛龙
pterosaur   冀龙
barosaurus  重龙
tyrannosaurus rex 霸王龙

Tuesday, February 12, 2013

find out longest running sql statement


select * from
(select sql_text,
rank() over ( order by buffer_gets desc ) as rank_bufgets,
to_char(100 * ratio_to_report(buffer_gets) over (), '999.99') pct_bufgets
from V$sql )
where rank_bufgets < 11;

Saturday, February 9, 2013

Pronunciation


hill/here/hear/walk/work
go and goal
bed and bad, cat, parent
mountain/button/
William
girl
two
在学习英语发音的时候,要学会解放自己的发音器官,更重要是解放自己的思想,遇到不会发的音,不要总往“顺耳”的方向走,而是要往“别扭”的方向尝试,具备了这样的素质和能力,你就开始摸到规律了。
tr、还有 dr,说难也难说简单其实也简单,英语的复合辅音其实也是单辅音的组合,这种组合可以说“技术含量”不会太高的,直接按次序读出即可。

你试试发普通话的“特-如”,这就是tr-的“慢放”,感受舌头从上颚逐渐向后卷缩的过程,重复多次,稍微加快速度继续重复,直至习惯为止;之后套入单词中,比如 “特如-ue”、“特如-uth”、“特如-affic”、“con-特如-ol”(大家也许会笑,但音其实就是这样发出来的),注意“特如-”还是要整个保持,不能省略简化,仅仅增加速度而已。

dr- 同理。
word 和world
where 和 wear
biology/kiosk zzhfrtyryu54rxxerthert34t3543

Tuesday, February 5, 2013

xiafei dai dentist


155 University Avenue
TorontoON M5H 3B7
Neighbourhoods: Financial District, Downtown Core
(416) 861-8251

Friday, February 1, 2013

Upload the specified files to the server

I often need remove the old data files, upload the new data files to the server, change permission, move it to another user's directory, change permission. And another file set ...
SFTP protocol cannot support the switch on session while it can be achieved by changing the permission.
The full file is in the mail attachment:
BackupDBBackupServerUpload.7z

Auto backup the server shell script

The hard disk was corrupted last week.
It's better to perform the backup automatically every day.
Use winscp open the sftp connection, call tar command and the get the tar file.

Auto backup Oracle ddl

A java program based on DBMS_METADATA.GET_DDL is used to customize the auto backup on oracle  ddl. So the daily changes on table, package ddl will not be lost.
import java.io.BufferedWriter;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

public class BackupDB {
//Only the below needs to change based on the environment
private static final String URL = "jdbc:oracle:thin:@localhost:1521:xe";
private static final String USER = "hr";
private static final String PASSWORD = "hr";
private static final String[] TYPES = {"PACKAGE","TABLE"};
//do not include the schema prefix
private static final String NO_SCHEMA = "BEGIN DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'EMIT_SCHEMA', false); END;";
//make it look pretty
private static final String PRETTY = "BEGIN DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'PRETTY', true); END;";
//don't include the physical properties
private static final String NO_PHYSICAL_PROP = "BEGIN DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'PHYSICAL_PROPERTIES', false); END;";
//don't include the segment attributes
private static final String NO_SEGMENT_PROP = "BEGIN DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'SEGMENT_ATTRIBUTES', false); END;";
//include a sql terminator for each statement
private static final String SQL_TERMINATOR = "BEGIN DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'SQLTERMINATOR', true); END;";
public static void main(String[] args) throws ClassNotFoundException, SQLException, IOException {
long start = System.currentTimeMillis();
exportDDL("ddlExport.sql");
long end = System.currentTimeMillis();
System.out.printf("Done. Spent %d secs.",(end-start)/1000);
}
public static void exportDDL(String fileName) throws ClassNotFoundException, SQLException, IOException {
Connection conn = DriverManager.getConnection(URL, USER, PASSWORD);
runCall(conn,NO_SCHEMA);
runCall(conn,PRETTY);
runCall(conn,NO_PHYSICAL_PROP);
runCall(conn,NO_SEGMENT_PROP);
runCall(conn,SQL_TERMINATOR);
List<String> resultList = new ArrayList<String>();
for(String type:TYPES){
List<String> ddlList = getDDLList(conn,type);
resultList.addAll(ddlList);
}
conn.close();
write(fileName, resultList);
}
private static List<String> getDDLList(Connection conn,String type) throws SQLException{
List<String> objectNameList = getObjectNameList(conn,type);
List<String> ddlList = new ArrayList<String>();
for(String objectName:objectNameList){
String sql = "select DBMS_METADATA.GET_DDL('"+type.toUpperCase()+"','"+objectName+"') from DUAL";
PreparedStatement preStatement = conn.prepareStatement(sql);
ResultSet result = preStatement.executeQuery();
while (result.next()) {
String ddl = result.getString(1);
ddlList.add(ddl);
}
result.close();
preStatement.close();
}
return ddlList;
}
private static List<String> getObjectNameList(Connection conn,String type) throws SQLException{
List<String> objectList = new ArrayList<String>();
String sql = "select object_name from user_objects where object_type = '"+type.toUpperCase()+"' order by 1";
PreparedStatement preStatement = conn.prepareStatement(sql);
ResultSet result = preStatement.executeQuery();
while (result.next()) {
String objectName = result.getString(1);
objectList.add(objectName);
}
result.close();
preStatement.close();
return objectList;
}
private static void runCall(Connection conn,String sql) throws SQLException{
CallableStatement cs = conn.prepareCall(sql);
cs.execute();
}
public static void write(String fileStr,Iterable<? extends Object> lines) throws IOException{
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(fileStr)));
        for (Object line: lines) {
            writer.append(line.toString());
            writer.newLine();
        }
writer.close();
}

}