[iOS] iPhone/iPad Keyboard Size and Resolution

Print Friendly

iOS Simulator Documents Directory on XCode 6 GM

Print Friendly

I just upgraded my Xcode to Xcode 6 GM, and it seems that the new Simulator is using a different file system path. I finally found the documents directory under

 

[LeetCode] Decode Ways

Print Friendly

Problem Description Analysis and Implementation Analyze the problem First of all, we construct a set which contains 1 to 26 as strings, so that we know the substring we are currently considering is a valid decoding or not.

Now we can use Dynamic Programming for this problem, denote a list called dp, which has…

Details

[LeetCode] ZigZag Conversion

Print Friendly

Problem Description The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)

And then read line by line: “PAHNAPLSIIGYIR” Write the code that will take a string and make this conversion given a…

Details

[Obj-C] A nice way to define application-wide constants

Print Friendly

In XCODE 5, New File→Objective-C class→give the file a name, for example: OLConstants. Then delete OLConstants.m, we won’t need it. Open your Application-Prefix.pch Add the following line right before #endif

In OLConstants.h, delete everything that is in the file right now. And to add a constant, just add a line like this

After…

Details

[Howto] Multi-lingual WordPress Setup without Plugin

Print Friendly

Read in Chinese As you can see that I write some of my blog posts in bilingual (English & Chinese), I really want to have a button on the post which will toggle the English part and Chinese part. It turns out this is really a simple task, so here you go. 我的Blog裡有些文章是有中英對照的,但是直接讓中英並列看起來實在很不好看,所以想來作一個按鈕讓讀者按下去後可以開關中文或英文部份。 Example on…

Details

[jQuery] Currency Textbox – A 2-digit decimal textbox

Print Friendly

I have been searching on the web for a currency-customized textbox, but it seems that this is a way-too-easy task and there is no one sharing an entire example. This kind of textbox is seen on some iOS apps (like American Express app) which makes people very easy to input without dot sign, and the developer won’t have to validate afterwards since the textbox itself is doing it.

我在網路上搜了一陣子但是都沒找到有人分享這種貨幣專用的輸入框,我想應該是太簡單了,不用怕使用者輸入錯,也不用多作驗證。我在American Express的iOS app裡看到,覺得非常方便。

This post is to demonstrate a customized textbox which does the following:

這篇文章是來介紹一個使用jQuery自定過的貨幣專用文字框,功能有

Details

[bash] Setup password-less ssh login to remote machine

Print Friendly

This is a simple script to automatically setup password-less ssh login to remote Linux box.
Note that this script uses [tooltip tip="a program to automate interactions with programs that expose a text terminal interface"]Expect[/tooltip].

這是一個簡單的script,自動設定免密碼ssh登入遠端機器。這個script使用[tooltip tip="a program to automate interactions with programs that expose a text terminal interface"]expect[/tooltip]

Details