slack 好用,
工作上討論比skype,Line好用
可以參考以下文章
http://www.playpcesor.com/2015/06/slack.html
2015年12月22日星期二
背景半透明且文字不透明的CSS寫法
背景半透明且文字不透明的CSS寫法
建議用rgba寫法,例如: background:rgba(255, 0, 0, 0.5);
不建議用以下寫法,會有問題:
opacity: 0.4;
背景文字都會半透明
參考:
具有半透明值 (alpha 色版) 的 CSS 3 顏色單位
建議用rgba寫法,例如: background:rgba(255, 0, 0, 0.5);
不建議用以下寫法,會有問題:
opacity: 0.4;
背景文字都會半透明
參考:
具有半透明值 (alpha 色版) 的 CSS 3 顏色單位
2015年12月15日星期二
2015年11月10日星期二
java http連線與傳送資料範例
以下是post 用utf-8編碼的方式
// HTTP POST request
private void sendPost() throws Exception {
String url = "http://127.0.0.1/test.php";
URL obj = new URL(url);
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("User-Agent", "Mozilla/5.0");
con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
String data = "id=UTF8中文字&pw=UTF8中文字";
con.setDoOutput(true);
DataOutputStream wr = new DataOutputStream(con.getOutputStream());
//wr.writeBytes(data);
wr.write(data.getBytes("utf-8"));//為了傳送utf8的文字改成這個
wr.flush();
wr.close();
int responseCode = con.getResponseCode();
System.out.println("Sending 'POST' request to URL : " + url);
System.out.println("Post parameters : " + data);
System.out.println("Response Code : " + responseCode);
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
}
CentOS權限設定,當使用java 的 FileInputStream
使用java的FileInputStream,在window可以執行,CentOS 7出現問題:
後來找到原因 :
CentOS 的目錄以及檔案的權限要設定
最小的設定如下:
Linux 指令:
- chmod o+r+w /weblog/Edit1.zip
- chmod o+x /weblog
2015年9月9日星期三
jQuery Validation Plugin
jQuery外掛jQuery.validate表單驗證
進階功能1 : 例如檢查欄位(name)只能輸入英文或數字.
以下是範例:
$.validator.addMethod("regex", function(value, element, regexpr) {
return regexpr.test(value);
},"請輸入英文或數字!");
$( "#registerForm" ).validate({
rules: {
name:{
regex: /^[a-zA-Z0-9]+$/
}
}
});
進階功能2 : 可以顯示不同的語言
例如 : 出現 中文或英文
2-1 javascript修改如下(紅色字體部分)
$.validator.addMethod("regex", function(value, element, regexpr) {
return regexpr.test(value);
}, jQuery.validator.messages.letterOrNumbers );
2.2 兩個js檔案必須各自增加一行
2.2.1 jquery-validation-1.13.1\dist\localization\messages_zh_TW.js
增加(紅色字體部分) :
$.extend($.validator.messages, {
......................
,letterOrNumbers : "請輸入英文或數字!"
});
2.2.2 /jquery-validation-1.13.1/dist/jquery.validate.js
增加(紅色字體部分) :
,letterOrNumbers : "Please enter letters and numbers only!"
2015年8月27日星期四
2015年8月26日星期三
SpringMVC常用注解實例詳解3:@ResponseBody
http://www.cnblogs.com/sunang/p/3429895.html另外,中文亂碼,解決方法:
http://blog.csdn.net/shuangde800/article/details/9098607
- <mvc:annotation-driven>
- <mvc:message-converters>
- <bean class="org.springframework.http.converter.StringHttpMessageConverter">
- <property name="supportedMediaTypes">
- <list>
- <value>text/plain;charset=UTF-8</value>
- <value>text/html;charset=UTF-8</value>
- </list>
- </property>
- </bean>
- </mvc:message-converters>
- </mvc:annotation-driven>
2015年8月18日星期二
Chrome另存網頁的時候,有時候儲存的網頁並不完整
可以試試以下的擴充功能:用途:
save web page to single file
Chrome 安裝下面兩個擴充功能:
https://chrome.google.com/webstore/detail/singlefile/mpiodijhokgodhhofbcjdecpffjipkle
https://chrome.google.com/webstore/detail/singlefile-core/jemlklgaibiijojffihnhieihhagocma?hl=zh-TW
使用方法:
https://www.youtube.com/watch?v=pFCJAFvc_MA
2015年8月6日星期四
2015年8月5日星期三
2015年7月6日星期一
不錯的文章
解決 Memory leak 有效掌握 Resource
http://www.mpinfo.com.tw/TechnologyColumnFiles/JavaAPsvr_A_200411_MemoryLeak.pdf
2015年3月24日星期二
2015年2月16日星期一
2015年2月12日星期四
DataTables : 使用javascript 做表格
最近需要使用javascript 做表格.
DataTables 這個javascript library還蠻好用的.
網址 : http://www.datatables.net/
教學與範例:
http://yhhuang1966.blogspot.tw/2013/05/jquery-datatable.html2015年1月22日星期四
Spring MVC 亂碼
第一個 Spring MVC 就遇到亂碼的問題
解決方式:
在web.xml中加入
在web.xml中加入
<filter> <filter-name>Encoding</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> <init-param> <param-name>forceEncoding</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>Encoding</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
訂閱:
留言 (Atom)



