Friday, November 12, 2010

Config file for VIM Cheating file (Version 11.11.2010)

In case you want a working Config for VIM, download it here.

Or you can copy and past the following into ~/.vimrc

It supports syntax, unlimited yank buffer size (default is 50 lines which is annoying), press space to page down just like a web browser. I will keep updating this file


" .vimrc by Junxian
" Version 11.11.2010
"
" All system-wide defaults are set in $VIMRUNTIME/debian.vim (usually just
" /usr/share/vim/vimcurrent/debian.vim) and sourced by the call to :runtime
" you can find below. If you wish to change any of those settings, you should
" do it in this file (/etc/vim/vimrc), since debian.vim will be overwritten
" everytime an upgrade of the vim packages is performed. It is recommended to
" make changes after sourcing debian.vim since it alters the value of the
" 'compatible' option.

" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages available in Debian.
runtime! debian.vim

" Uncomment the next line to make Vim more Vi-compatible
" NOTE: debian.vim sets 'nocompatible'. Setting 'compatible' changes numerous
" options, so any other options should be set AFTER setting 'compatible'.
"set compatible

" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
syntax on

" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
"set background=dark

" Uncomment the following to have Vim jump to the last position when
" reopening a file
if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal! g'\"" | endif
endif

" Uncomment the following to have Vim load indentation rules according to the
" detected filetype. Per default Debian Vim only load filetype specific
" plugins.
if has("autocmd")
filetype indent on
set autoindent
endif

" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
set showcmd " Show (partial) command in status line.
set showmatch " Show matching brackets.
set ignorecase " Do case insensitive matching
set smartcase " Do smart case matching
set incsearch " Incremental search
set autowrite " Automatically save before commands like :next and :make
set hidden " Hide buffers when they are abandoned
"set mouse=a " Enable mouse usage (all modes) in terminals

" Source a global configuration file if available
" XXX Deprecated, please move your changes here in /etc/vim/vimrc
if filereadable("/etc/vim/vimrc.local")
source /etc/vim/vimrc.local
endif

" Turn on line numbering. Turn it off with "set nonu"
set number

"all PHP files in current file's directory and recursively will be scanned
"use mapping to re-build tags files after editing
nmap
\ :!ctags -f %:p:h/tags
\ --langmap="php:+.inc"
\ -h ".php.inc" -R --totals=yes
\ --tag-relative=yes --PHP-kinds=+cf-v %:p:h
set tags=./tags,tags


"Tell me where I am
set ruler


" Higlhight search
set hls
" Map Ctrl+N to remove highlight
nmap :silent noh

" make that backspace key work the way it should
set backspace=indent,eol,start

" make space = page down
nmap

" remove the buffer limit when dong yank to copy and past in VIM
set viminfo='100,h

Thursday, September 16, 2010

How to add multiple Icons for iPhone/iPad/iPhone 4 with different resolutions?

This post pretty much solves the problem completely.

I haven't tried myself, but it looks promising.

Monday, May 10, 2010

Mac OS 10.6 Snow Leopard problem after installing MacPorts

ps2pdf14 paper.ps paper.pdf
dyld: Library not loaded: /opt/local/lib/libX11.6.dylib
Referenced from: /opt/local/bin/gs
Reason: no suitable image found. Did find:
/opt/local/lib/libX11.6.dylib: mach-o, but wrong architecture
make: *** [paper.pdf] Trace/BPT trap


So you need to copy all libs from /usr/X11R6/lib/ to /opt/local/lib/

Sunday, March 28, 2010

How to jailbreak iPod Touch 3.1.3 with MAC OS X

First, degrade you iPod to 3.1.2 because 3.1.3 is not well-supported by iPhone's hackers' community.
For iPod 2G, you need "iPod2,1_3.1.2_7D11_Restore.ipsw"
It can be downloaded by searching the file name.

Then follow the steps here
http://tysiphonehelp.com/?p=482

Very simple and I just tried, it works

Monday, February 22, 2010

How to read crash log file for iPhone OS

Search in your "spotlight" for : symbolicatecrash
Or you can download it here

Run:

./symbolicatecrash log.crash test.app.dSYM

The output will transform the memory address to line number and file name.

This will help you a lot in debugging iPhone's Apps, especially when the crash log is from Apple App Review Team (who sucks!!).

Before symbolication, the crash log is like:

"
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]

Date/Time: 2010-02-22 22:07:41.175 -0500
OS Version: iPhone OS 3.1.3 (7E18)
Report Version: 104

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0

Thread 0 Crashed:
0 libSystem.B.dylib 0x33994b2c 0x33904000 + 592684
1 libSystem.B.dylib 0x33994b1a 0x33904000 + 592666
2 libSystem.B.dylib 0x33994b0e 0x33904000 + 592654
3 libSystem.B.dylib 0x339abe34 0x33904000 + 687668
4 libstdc++.6.dylib 0x30800390 0x3079a000 + 418704
5 libobjc.A.dylib 0x3336e898 0x33366000 + 34968
6 libstdc++.6.dylib 0x307fda84 0x3079a000 + 408196
7 libstdc++.6.dylib 0x307fdafc 0x3079a000 + 408316
8 libstdc++.6.dylib 0x307fdc24 0x3079a000 + 408612
9 libobjc.A.dylib 0x3336ce54 0x33366000 + 28244
10 CoreFoundation 0x3387db2c 0x33857000 + 158508
11 CoreFoundation 0x3387dacc 0x33857000 + 158412
12 Foundation 0x32e9970a 0x32e78000 + 136970
13 Foundation 0x32ebf520 0x32e78000 + 292128
14 Show Off 0x00002caa -[AppDelegate applicationDidFinishLaunching:] (AppDelegate.m:164)
15 UIKit 0x32003e88 0x31fff000 + 20104
16 UIKit 0x32003a60 0x31fff000 + 19040
17 UIKit 0x32054df8 0x31fff000 + 351736
18 UIKit 0x32054634 0x31fff000 + 349748
19 UIKit 0x3205408c 0x31fff000 + 348300
20 GraphicsServices 0x3434f7dc 0x3434a000 + 22492
21 CoreFoundation 0x338ae524 0x33857000 + 357668
22 CoreFoundation 0x338adc18 0x33857000 + 355352
23 UIKit 0x32002c00 0x31fff000 + 15360
24 UIKit 0x32001228 0x31fff000 + 8744
25 Show Off 0x000027a0 main (main.m:7)
26 Show Off 0x0000273c start + 44

"

After transformation, it looks like:
"
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]

Date/Time: 2010-02-22 14:27:43.947 -0800
OS Version: iPhone OS 3.1.3 (7E18)
Report Version: 104

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0

Thread 0 Crashed:
0 libSystem.B.dylib 0x33994b2c 0x33904000 + 592684
1 libSystem.B.dylib 0x33994b1a 0x33904000 + 592666
2 libSystem.B.dylib 0x33994b0e 0x33904000 + 592654
3 libSystem.B.dylib 0x339abe34 0x33904000 + 687668
4 libstdc++.6.dylib 0x30800390 0x3079a000 + 418704
5 libobjc.A.dylib 0x3336e898 0x33366000 + 34968
6 libstdc++.6.dylib 0x307fda84 0x3079a000 + 408196
7 libstdc++.6.dylib 0x307fdafc 0x3079a000 + 408316
8 libstdc++.6.dylib 0x307fdc24 0x3079a000 + 408612
9 libobjc.A.dylib 0x3336ce54 0x33366000 + 28244
10 CoreFoundation 0x338ecbf6 0x33857000 + 613366
11 CoreFoundation 0x33871b12 0x33857000 + 109330
12 CoreFoundation 0x33868838 0x33857000 + 71736
13 test 0x0001a4ce -[TTViewController shouldAutorotateToInterfaceOrientation:] (TTViewController.m:197)
14 UIKit 0x32085988 0x31fff000 + 551304
15 UIKit 0x320efe38 0x31fff000 + 986680
16 UIKit 0x320b439c 0x31fff000 + 742300
17 test 0x000155be -[TTTableViewController initWithStyle:] (TTTableViewController.m:128)
18 test 0x0001458e -[TTTableViewController init] (TTTableViewController.m:135)
19 test 0x0000343e -[CatalogController init] (CatalogController.m:11)
20 test 0x0003f1fc -[TTURLNavigatorPattern createObjectFromURL:query:] (TTURLPattern.m:747)
21 test 0x0003dc9e -[TTURLMap objectForURL:query:pattern:] (TTURLMap.m:304)
22 test 0x000426c4 -[TTNavigator viewControllerForURL:query:pattern:] (TTNavigator.m:478)
23 test 0x0004291c -[TTNavigator openURL:parent:query:state:animated:transition:withDelay:] (TTNavigator.m:238)
24 test 0x00041d12 -[TTNavigator openURL:animated:] (TTNavigator.m:390)
25 test 0x00002d66 -[AppDelegate applicationDidFinishLaunching:] (AppDelegate.m:133)
26 UIKit 0x32003e88 0x31fff000 + 20104
27 UIKit 0x32003a60 0x31fff000 + 19040
28 UIKit 0x32054df8 0x31fff000 + 351736
29 UIKit 0x32054634 0x31fff000 + 349748
30 UIKit 0x3205408c 0x31fff000 + 348300
31 GraphicsServices 0x3434f7dc 0x3434a000 + 22492
32 CoreFoundation 0x338ae524 0x33857000 + 357668
33 CoreFoundation 0x338adc18 0x33857000 + 355352
34 UIKit 0x32002c00 0x31fff000 + 15360
35 UIKit 0x32001228 0x31fff000 + 8744
36 test 0x00002968 main (main.m:7)
37 test 0x00002924 start + 44

"