2016年3月25日

[GIT] 指令

git log --name-status

File status flags:
M modified - File has been modified
C copy-edit - File has been copied and modified
R rename-edit - File has been renamed and modified
A added - File has been added
D deleted - File has been deleted
U unmerged - File has conflicts after a merge

2016年3月21日

[MySQL] UPDATE時出現Error Code: 1175

Error Code: 1175 You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column

百思不得其解update語法哪裡有錯==

原來是workbench的關係

解法:

Edit→Preferences

[SQL Editor]

勾掉[Forbid UPDATE and DELETE statements without a WHERE clause (safe updates)]

 [OK]

 重開Workbench(不然沒效)

2016年2月25日

quartz cron時間參數

http://www.zgxue.com/198/1982002.html

秒 分 時 日 月 星期 (年)

星期 1=SUN

星號(*)

每個時間點都可以存在,表示每一個___執行

ex:標在月 :*=1-12:每個月都從執行
ex:0 * * 1 * ? :每月1號凌晨都會被執行。
ex:0 * * ? * * :每分鐘的00秒被執行。

問號(?)

在cron表達式中,必定存在,有且只有一個,只能在日和星期
與「*」不同,是不管月的哪一天或是星期的哪一天。
if在星期定義具體的數值,日必須為問號(?)
if在日定義具體的數值,星期就必須為問號(?)
(為避免含糊不清的表達方式,如3月的第20天,剛好是第三週的第5天,那如果在日定義20,星期定義5這樣,就雙重定義,cron表達式不允許)

ex:0 10 18 ? 3 WEB:每年3月的每個星期三,下午6點10分都會被觸發

ex:0 10 18 15 3 ?:每年三月的第15天,下午6點10分都會被觸發



斜線(/)

a/b
可在任何時間點,表示增量,a為起始值,然後每隔b做一次

ex:5/20 * * ? * *:每分鐘的第5秒,第25秒,第45秒 都會被執行。

ex:0 * 2/2 ? * * :每天的第2小時,第4小時,第6小時,第8小時 ... 第22小時的00分00秒都會被觸發。


井號(#)

a#b
只能在星期,表示每月的第b個星期a,若超出範圍 忽略不記

ex:* * * ? * 3#4 :每月的第4個星期的周2,凌晨觸發。

ex:* * * ? * 6#2:每月的第2個星期的周5,凌晨觸發



L

用在日、星期
在日:一個月的最後一天
在星期:L=7=SAT

aL
前面加上數字
在日:一個月的最後a天
在星期:ex:6L:就表示月的最後一個星期五


W

只在日出現。指定日期的最近工作日。
ex:在日:15W:這個月15號最近的工作日。
(if15號是週六,則會在14號觸發
if15是週日,則會在週一也就是16號觸發)
※1W:即使1號是週六,也只會在下週一(3號)觸發∵最近工作日不能夠跨月份
※只能配合一個單獨的數值使用,不能為一個數字段(1-15W)


LW

L和W可以在日中一起使用,表示這個月最後一週的工作日


#

a#b
只在星期出現,表示在月的第b個星期a
ex:6#3:月第三週的星期五
ex:2#1:月第一週的星期一
ex:4#5:第五週的星期三


C

在日和星期出現。依據一個指定的「日曆」,若無「日曆」關聯,等同於所有包含的「日曆」。
ex:在日:5C:關聯「日曆」五日後的第一天,或者這個月開始的第一天的後5天。
ex:在星期:1C:星期的第一天的後1天=週日的後一天=週一


允許的特殊字元

允許值
允許的特殊字元
0-59
, - * /
0-59
, - * /
0-23
, - * /
1-31
, - * ? / L W C
1-12 或者 JAN-DEC
, - * /
星期
1-7 或者 SUN-SAT
, - * ? / L C #
年(可選)
留空, 1970-2099
, - * /




2016年1月28日

[JQuery] 讓textfield 看的到 但不能用

$("input[type=text]").focus(function(){
 this.blur();
 });

[JQuery] on() bind() delegate()

bind(type, [data], fn)

on(type,[selector],[data],fn)


on可以有selector



delegate()可以指定未來元素 取代live()


.on()是最新的1.9版本整合了之前的三種方式的新事件綁定機制

[JQuery] 動態調整字大小 div大小

$("#try2").click(function(){
 
 
      $("#t").css({
   
      height:function(index,value){
        return parseFloat(value)/1.2;
      },
     
        fontSize:function(index,value){
          return parseInt(value)*1.2;
        }
    });
 
 
 
  });


字大小要用parseInt

2016年1月19日

[MAC] 快速鍵

fn+delete

command+上下左右



⌘(Command 鍵):有時稱為「Apple 鍵」。這個鍵在 Apple Keyboard 鍵盤上也有 Apple 標誌 ()

^(Control 鍵)

⌥(Option 鍵):這個按鍵也可能有「Alt」字樣

⇧(Shift 鍵)

⇪(Caps Lock):切換 Caps Lock 開關

Fn (功能鍵):位於可攜式 Mac 內建鍵盤的左下角 



音量微調:shift + option
(調低1/4格:shift + option + F12
調高1/4格:shift + option + F1)

2016年1月15日

[Spring] Resource strings


PrefixExampleExplanation
classpath:classpath:com/myapp/config.xmlLoaded from the classpath.
file:file:/data/config.xmlLoaded as a URL, from the filesystem. [1]
http:http://myserver/logo.pngLoaded as a URL.
(none)/data/config.xmlDepends on the underlying ApplicationContext.

classpath* vs. classpath

classpath只會找package下第一個找到的

classpath*會找到所有的符合條件的 包含jar檔內

一般情況下沒必要用classpath*

2016年1月11日

Eclipse jsp 預設 encoding改為utf8

Windows -> Preferences -> Web -> JSP Files
Select UTF-8 encoding from the *Encoding *dropdown box there.