跳到主要內容

發表文章

Node.js 上傳檔案

  Node.js 入門 http://www.nodebeginner.org/index-zh-tw.html Download https://nodejs.org/en/download/   安裝過程︰ 下載msi並安裝 安裝express: npm install -g express npm install -g express-generator   上下傳 file 範例 - Node.js http://iosdevelopersnote.blogspot.tw/2012/08/file-nodejs.html   Express框架 http://javascript.ruanyifeng.com/nodejs/express.html   nodejs小问题:[1]express不是内部或外部命令 http://jingyan.baidu.com/article/922554468a3466851648f419.html

[Swift] String Format for NT$

  var amount = NSNumber(int: 8880) var _currencyFormatter = NSNumberFormatter() _currencyFormatter.numberStyle = NSNumberFormatterStyle.DecimalStyle //_currencyFormatter.currencyCode = "NT$ " //_currencyFormatter.formatterBehavior = NSNumberFormatterBehavior.BehaviorDefault //_currencyFormatter.negativeFormat = "-$#,##0" _currencyFormatter.positiveFormat = "NT$ #,##0" _currencyFormatter.stringFromNumber(amount)   輸出結果︰ NT$ 8,880   參考︰ http://www.cokco.cn/thread-35548-1-1.html http://www.freair.com/bbs/simple/?t558.html

[IOS] 自動增加 build number

  if [ "${CONFIGURATION}" = "Release" ]; then // script buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}") buildNumber=$(($buildNumber + 1)) /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE" /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" fi   參考︰ http://nerds.weddingpartyapp.com/tech/2014/07/10/automatic-build-numbers-in-xcode/

英打復習

記得當兵的時候,同梯的營參四問我有沒有好用的輸入法 所以我就給了他嘸蝦米輸入法,我大學時練過,不過沒練起來,那時還是用一指神功… 然後我就跟說欲練神功必先自…不是啦,我是說要練中打必要先練英打才行! 過了一個禮拜,再遇到他,他說他嘸蝦米練起來了,我說屁啦~他說不信你看… 我說你英打怎麼練起來的,他說就a到z打10遍就練起來啦,我說怎麼可能!! 他說不信你試試~ abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqtstuvwxyz abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvexyz 然後…我英打就練起來了

[NOTE] Swift

if if else 判斷時,可超合 && 和 || if的()可以不需使用! 比較字串是否相等時,就是用 ==,會比較字串是否相同 若是比較字定義的物件是否相等時,要用 ===,會比較是否為同一物件   switch case 可以不用() 可以比對任何型別 每個case裡的command執行完就會自動break,所以不用每行都加break case裡不可以是空的,若一定是空的,就給他一個break 加上fallthrough可以繼續執行下一個case case可以有多個符合條件,用逗號分開(case 1,100: )   for for i in 1..3 { // 1,2 } 2015/09/12 幹,上面兩個點的已經不能用了 for i in 1..<3 { // 1,2 }   for i in 1…3 { // 1,2,3 } // 印出每個字元 var name = “ABC" for char in name { }   optional 宣告optional時,問號需跟變數型別沒有間隔 var age: Int? , 不能是 var age: Int ? 加上?後,會被自動初始化為nil //判斷optional是否有值,有值再access if let ageNumber = age { } if var ageNumber = age{ } 加上?表示為optional型別,加上!表示自動解包裝(Implicitly Unwrapped Optionals),直接從optional取值 var aa = age ?? 30 // ?? 為optional加上預設值,當nil時會用預設值。注︰??左右要有空白!!   function func eat(name:String, foodPrice price:Int) // 外部參數名稱(可省略) 內部參數名稱: 參數型別 func eat(name:String, price price:Int) // 外部參數名稱與內部參數名稱相同也可以但會有警告 func eat(name:String, #price :int) // 加上#表示會自動產生同名的外部參數名稱 fun...

[NOTE] SOAP(Web Service) with Swift

Access REST Web Service with Apple’s new Swift Language http://network-development.blogspot.tw/2014/06/access-rest-web-service-with-apples-new.html         for Objective-C How to Write an iOS App That Uses a Web Service http://www.raywenderlich.com/2965/how-to-write-an-ios-app-that-uses-a-web-service