SELECT to_date('19700101','yyyymmdd') + (TIMESTAMP_VALUE/1000/24/60/60) AS date_time FROM TABLENAME;
解决idea环境代码保存后不能实时编译的问题
1.在项目目录下运行 mvn idea:idea
2. cd yourporject/path, rm *.iml *.ipr *.iws, the reopen idea, 重新在idea中执行maven build
3. Alt+shift+A, Type:Registry 选择 compiler.automake.allow.when.app.running 打勾
自定义XStream fields序列化顺序
1. XMLSequence : 注解用于TestXml class
2. TestXml : Class for xstream fields
3. PartialSeqFieldKeySorter: 自定义fields顺序,toXml输出
import com.thoughtworks.xstream.converters.reflection.FieldKey; import com.thoughtworks.xstream.converters.reflection.FieldKeySorter; import com.thoughtworks.xstream.core.util.OrderRetainingMap; import java.lang.annotation.Annotation; import java.lang.reflect.Field; import java.util.LinkedHashMap; import java.util.Map; import java.util.Set; public class PartialSeqFieldKeySorter implements FieldKeySorter { @Override public Map sort(Class type, Map keyedByFieldKey) { Annotation sequence = type.getAnnotation(XMLSequence.class); if (sequence != null) { final String[] fieldsOrder = ((XMLSequence) sequence).value(); Mapcustom = new LinkedHashMap<>(); Map notCustom = new LinkedHashMap<>(); Set > fields = keyedByFieldKey.entrySet(); for (String fieldName : fieldsOrder) { if (fieldName != null) { for (Map.Entry fieldEntry : fields) { if (fieldName.equalsIgnoreCase(fieldEntry.getKey().getFieldName())) { custom.put(fieldEntry.getKey(), fieldEntry.getValue()); } } } } return custom; } else { return keyedByFieldKey; } } }
Oracle 修改blob为clob,clob为blob
应用条件
1. blob 包含文本, 内容并不是很多
2. 备份blob文本到clob
3. oracle v11
blob to clob
--Add new clob column ALTER TABLE TABLENAME ADD (CLOB_COLUMN CLOB); --copy blob value to clob UPDATE TABLENAME SET CLOB_COLUMN = UTL_RAW.CAST_TO_VARCHAR2(DBMS_LOB.SUBSTR(BLOB_COLUMN,2000)); --drop blob ALTER TABLE TABLENAME DROP COLUMN BLOB_COLUMN; --rename clob column, name same as blob's ALTER TABLE TABLENAME RENAME COLUMN CLOB_COLUMN TO BLOB_COLUMN_NEW_NAME;clob to blob
--Add new blob column ALTER TABLE TABLENAME ADD (BLOB_COLUMN BLOB); --copy clob to blob UPDATE TABLENAME SET BLOB_COLUMN = UTL_RAW.CAST_TO_RAW(CLOB_COLUMN); -- drop clob ALTER TABLE TABLENAME DROP COLUMN CLOB_COLUMN; --rename blob column ALTER TABLE TABLENAME RENAME COLUMN BLOB_COLUMN TO BLOB_COLUMN_NEW_NAME;
Apple Script: 备份Mac Notes到PDFs
1. 打开Notes 点击准备备份目录的起始note
2. Copy 脚本到Mac ScriptEditor 然后运行
3. 生成 PDFs
4. OS: Catalina 10.15.X
set cnt to 58 set i to 0 tell application "System Events" repeat cnt times tell process "Notes" set frontmost to true click menu item "Export as PDF…" of menu 1 of menu bar item "File" of menu bar 1 delay 2 key code 76 key code 1 using {command down} delay 1 key code 15 using {command down} delay 5 key code 125 end tell end repeat end tell