跳到主要內容

發表文章

JSON in javascript

印出所有的JSON內容: console.log(JSON.stringify(josnObj));     增加資料到 JSON Array: var jsonArray = []; jsonArray.push(“xxxxxxxx”); jsonArray.push({     “key”: value });   Jason array size: Object.keys(jsonArray).length

Thread Safe Method for Java

class MyCounter {     private static int counter = 0;     public static synchronized int getCount() {         return counter++;     } } from http://www.programcreek.com/2014/02/how-to-make-a-method-thread-safe-in-java/ 寫了一陣子iOS,感覺Java已經離我很遠了~ 只記得有這東西,但不記得怎麼用了…

[IOS] 中文字串比大小

//程式碼 func compartStringByUnicode(string1 string1: String, string2: String, asc: Bool, index: Int)->Bool{ MyVariables.logger.debug("===============> index=\(index), asc=\(asc)") let string1LengthEnough = string1.length > index let string2LengthEnough = string2.length > index if string1LengthEnough && string2LengthEnough { let targetChar1 = string1.characters.map { String($0) }[index] let targetChar2 = string2.characters.map { String($0) }[index] for u1 in targetChar1.utf16 { for u2 in targetChar2.utf16 { if u1 == u2 { return compartStringByUnicode(string1: string1, string2: string2, asc: asc, index: (index+1)) }else{ MyVariables.logger.debug("\(targetChar1) (\(u1), \(targetChar2) (\(u2)) ==> \(u1 < u2)") if asc { ...

CoronaSDK scene template

----------------------------------------------------------------------------------------- -- -- covermenu.lua -- TapTapUFO -- -- Created by Kirk Hsu on 2016/04/06. -- Copyright © 2016年 Kirk Hsu. All rights reserved. -- ----------------------------------------------------------------------------------------- -- 引入各種函試庫 local widget = require("widget") local composer = require("composer") local scene = composer.newScene() -- 以下為定義變數 -- 以上為定義變數 -- 以下為定義其他函式 -- 以上為定義其他函式 -- composer function scene:create(event) local screenGroup = self.view print("scene create") -- todo end function scene:show(event) if event.phase == "did" then print("scene did show") -- todo end end function scene:hide(event) if event.phase == "will" then print("scene will hide") -- todo end end function scene:destroy(event) if event.phase == "will" then print("scene will destroy") -- todo end end scene:addE...

Corona SDK template

----------------------------------------------------------------------------------------- -- -- main.lua -- ProjectName -- -- Created by Kirk Hsu on 2016/04/06. -- Copyright © 2016年 Kirk Hsu. All rights reserved. -- ----------------------------------------------------------------------------------------- --display.setStatusBar( display.DefaultStatusBar ) --display.setStatusBar( display.DarkStatusBar ) display.setStatusBar( display.HiddenStatusBar ) --display.setStatusBar( display.TranslucentStatusBar ) -- 以下為定義變數 -- 以上為定義變數 local main = function() end -- 以下為定義其他函式 -- 以上為定義其他函式 main() -- 呼叫main()函式

iOS作品集(2016/03/31)

APP專案作品︰ 顯示加密內文 自己的作品︰ 台股評價分析   台股營收分析   台股獲利分析   選擇權策略   靠譜(for iPad)   LiveTV        

[MAC] 將wav+cue檔切成mp3

有時從網路取得的檔案會是一整個wav或flac再加一個cue檔來描述 但這種檔案在播放時得用特定的軟體來播,所以還是分開來比較方便~   軟體位置 http://external.informer.com/mediahuman.com/youtube-to-mp3-converter   wav and cue file               開啟app並將wav檔拉進去                                     點Yes,                                        設定輸出的格式,因為是自己要聽的,就選高一點                     全選匯出就完成啦                                       會多一個新的目錄Converted by MediaHuman,切好的檔案會在這                     至於中文亂碼的問題,我是再打開Tag Editor Free來編輯~