The Mobile Galaxy The New Mobile Era Has Come | Mobile – A Time To Remember


Installing PyGTK on Mac Lion


I assume you want to install gtk at ~/gtk, if not change the instructions accordingly.

First we need to install JHBuild:
curl -o
Once JHBuild is installed run these commands:
export PATH=$HOME/.local/bin:$PATH
vi  ~/.jhbuildrc-custom

add the line:

build_policy = "updated-deps"

Save and exit the file.

By default JHBuild will install gtk to ~/gtk, if you want a different location edit ~/.jhbuildrc and change the install directory.

We are now ready to build GTK:
jhbuild bootstrap
Fix gettext error:

Fix gettext issue with compilation under OS X Lion by editing a single line in the source (I use vi, but use whatever editor you like):
vi ~/gtk/source/gettext-
Change line 34, replacing __stpncpy with __stncpy (no “p”) at the beginning of the line. Save and exit the file.

Once done then run:
jhbuild build meta-gtk-osx-bootstrap
jhbuild build meta-gtk-osx-core

Fix error:
GTK doesn't build on Lion because of a small problem at the linking step with a test program named "autotestkeywords". Please find the build log and patch attached. Does anyone know why including only headers in a file like would cause the symbol "_objc_msg_send_fixup" to be generated when using the 10.7 SDK as opposed to the 10.6 SDK? In any case, the patch causes linkage with the requisite frameworks.

vi ~/gtk/source/gtk+-2.24.0/tests/


old new
89 89 @HAVE_CXX_TRUE@am_autotestkeywords_OBJECTS =  \
90 90 @HAVE_CXX_TRUE@ autotestkeywords-autotestkeywords.$(OBJEXT)
91 91 autotestkeywords_OBJECTS = $(am_autotestkeywords_OBJECTS)
92 autotestkeywords_LDADD = $(LDADD)
93 92 AM_V_lt = $(am__v_lt_$(V))
94 93 am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
95 94 am__v_lt_0 = --silent
685 684 testtooltips_DEPENDENCIES = $(TEST_DEPS)
686 685 testvolumebutton_DEPENDENCIES = $(TEST_DEPS)
687 686 testwindows_DEPENDENCIES = $(TEST_DEPS)
687 autotestkeywords_LDADD = $(LDADDS)
688 688 flicker_LDADD = $(LDADDS)
689 689 simple_LDADD = $(LDADDS)
690 690 print_editor_LDADD = $(LDADDS)
jhbuild build meta-gtk-osx-python

jhbuild build meta-gtk-osx-themes
GTK and PyGTK should now have been built.

Now navigate to ~/gtk/inst/lib/python2.7/site-packages and copy the contents of the site-packages folder to

Or run:
echo "import site; site.addsitedir('~/gtk/inst/lib/python2.7/site-packages')" > /Library/Python/2.7/site-packages/gtkredirect.pth
Obviously replace ~/gtk/inst with the path to your gtk installation.

You got it, PyGTK.
The attached is compiled package. PyGTK2.24.6.Don't forget to modify
/Library/Python/2.7/site-packages/gtkredirect.pth to this package. :)
Tagged as: , No Comments

Objective-C 声明中加减号区别


-(void) action:(bool) enable
    //do something

Unhide Library Folder in Mac OS X 10.7 Lion

Okay, so I know most of you probably don't have the dev release of Mac OS X 10.7 Lion, but I got it today, and a really big thing was changed... Apple hid the Library folder which is usually in your Home folder. After a little bit of searching, I found the answer on how to unhide it.

Because it is a folder hidden by Apple, it is flagged, so the Terminal command would be:

chflags nohidden /Users/<Username>/Library

or use an easier way.

chflags nohidden ~/Library/

This is especially helpful in Lion, yet it can be used in previous versions of Mac OS X.

Just a tip, if you want to unhide any file or folder on Mac that you hid using a period in front of its name, you can use this command:

mv /path/to/file/.name /path/to/file/newname

Hope this saves you the hassle of looking all over for these commands like I had to do!

Tagged as: No Comments


实际上UITableView默认就支持象电话本那样的按首字母索引。 实现sectionIndexTitlesForTableView 和 sectionForSectionIndexTitle 这两个接口即可。 细节请参考UITableViewDataSource帮助文档。

- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView

NSMutableArray *toBeReturned = [[NSMutableArray alloc]init];

for(char c = ‘A’;c<=‘Z’;c++)

[toBeReturned addObject:[NSString stringWithFormat:@"%c",c]];

return toBeReturned;


- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index

NSInteger count = 0;

for(NSString *character in arrayOfCharacters)


if([character isEqualToString:title])


return count;


count ++;


return 0;


- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section

if([arrayOfCharacters count]==0)


return @”";


return [arrayOfCharacters objectAtIndex:section];


FFMPEG Video/Audio Encoding Cheat Sheet


Video Size and Aspect Ratios


Name Size Aspect
Wide 16:9 480x270 4:3
Old TV 4:3 427x320 16:9
Wide 16:9 /16 480x272 480:272
Old TV 4:3 /16 432x320 432:320


Name Size Aspect
Wide 16:9 720x480 16:9
Old TV 4:3 720x480 4:3

Youtube and Vimeo Upload

Name Size Aspect
SD 4:3 640:480 4:3
HD 16:9 1280x720 16:9

HD, Blu-Ray, AVCHD

Name Size Aspect
720p 1280x720 16:9
1080p/i Anamorphic 1440x1080 16:9
1080p/i 1920x1080 16:9

Frame Rates

Name Standard Fps FFmpeg
Movies NTSC 23.976 24000/1001
Movies QuickTime N/A 29.976 10000000/417083
TV Video NTSC 29.97 30000/1001
Movies PAL 25 25
TV Video PAL 30 30

FFmpeg Encoding

X264 Presets

default fastfirstpass lossless_ultrafast lossless_slower
baseline slowfirstpass lossless_fast lossless_max
normal hq lossless_medium ipod320
main max lossless_slow ipod640

High quality 2 Pass

ffmpeg -y -i INPUT -r 30000/1001 -b 2M -bt 4M -vcodec libx264 -pass 1 -vpre fastfirstpass -an output.mp4
ffmpeg -y -i INPUT -r 30000/1001 -b 2M -bt 4M -vcodec libx264 -pass 2 -vpre hq -acodec libfaac -ac 2 -ar 48000 -ab 192k output.mp4

iPod-iPhone 320 width

ffmpeg -i INPUT -s 320x240 -r 30000/1001 -b 200k -bt 240k -vcodec libx264 -vpre ipod320 -acodec libfaac -ac 2 -ar 48000 -ab 192k output.mp4

iPod-iPhone 640 width

ffmpeg -i INPUT -s 640x480 -r 30000/1001 -b 200k -bt 240k -vcodec libx264 -vpre ipod640 -acodec libfaac -ac 2 -ar 48000 -ab 192k output.mp4

Hight quality, 2 pass without presset

ffmpeg -y -i input -r 24000/1001 -b 6144k -bt 8192k -vcodec libx264 -pass 1 -flags +loop -me_method dia -g 250 -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -bf 16 -b_strategy 1 -i_qfactor 0.71 -cmp +chroma -subq 1 -me_range 16 -coder 1 -sc_threshold 40 -flags2 -bpyramid-wpred-mixed_refs-dct8x8+fastpskip -keyint_min 25 -refs 1 -trellis 0 -directpred 1 -partitions -parti8x8-parti4x4-partp8x8-partp4x4-partb8x8-an output.mp4

ffmpeg -y -i input -r 24000/1001 -b 6144k -bt 8192k -vcodec libx264 -pass 2 -flags +loop -me_method umh -g 250 -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -bf 16 -b_strategy 1 -i_qfactor 0.71 -cmp +chroma -subq 8 -me_range 16 -coder 1 -sc_threshold 40 -flags2 +bpyramid+wpred+mixed_refs+dct8x8+fastpskip -keyint_min 25 -refs 4 -trellis 1 -directpred 3 -partitions +parti8x8+parti4x4+partp8x8+partb8x8-acodec libfaac -ac 2 -ar 44100 -ab 128k output.mp4

iPod-iPhone 320 width, without presset

ffmpeg -i INPUT -s 320x240 -r 30000/1001 -b 200k -bt 240k -vcodec libx264 -coder 0 -bf 0 -flags2 -wpred-dct8x8 -level 13 -maxrate 768k -bufsize 3M-acodec libfaac -ac 2 -ar 48000 -ab 192k output.mp4

iPod-iPhone 640 width, without presset

ffmpeg -i INPUT -s 320x240 -r 30000/1001 -b 200k -bt 240k -vcodec libx264 coder 0 -bf 0 -refs 1 -flags2 -wpred-dct8x8 -level 30 -maxrate 10M -bufsize 10M-acodec libfaac -ac 2 -ar 48000 -ab 192k output.mp4

iPod-iPhone, 2 pass custom

ffmpeg -y -i input -r 30000/1001 -s 480x272 -aspect 480:272 -vcodec libx264 -b 512k -bt 1024k -maxrate 4M -flags +loop -cmp +chroma -me_range 16 -g 300 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -rc_eq "blurCplx^(1-qComp)" -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -coder 0 -refs 1 -bufsize 4M -level 21 -partitions parti4x4+partp8x8+partb8x8 -subq 5 -f mp4 -pass 1 -an -title "Title" output.mp4

ffmpeg -y -i input -r 30000/1001 -s 480x272 -aspect 480:272 -vcodec libx264 -b 512k -bt 1024k -maxrate 4M -flags +loop -cmp +chroma -me_range 16 -g 300 keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -rc_eq "blurCplx^(1-qComp)" -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -coder 0 -refs 1 -bufsize 4M -level 21 -partitions parti4x4+partp8x8+partb8x8 -subq 5 -f mp4 -pass 2 -acodec libfaac -ac 2 -ar 44100 -ab 128k -title "Title" output.mp4

DV Video


ffmpeg -i input -target ntsc-dv -aspect 4:3 -y output.dv

From DV To Microsoft AVI DV

ffmpeg -i input.dv -vcodec copy -vtag dvsd -acodec pcm_s16le -f avi -aspect 4:3 -y output.avi


AAC Stereo HQ

-acodec libfaac -ac 2 -ar 48000 -ab 192k

AAC Stereo SQ

-acodec libfaac -ac 2 -ar 44100 -ab 128k

AAC 5.1 HQ

-acodec libfaac -ac 6 -ar 48000 -ab 448k

AAC 5.1 LQ

-acodec libfaac -ac 6 -ar 44100 -ab 224k

AAC to AC3 (Recomended use AviSynth for channel mapping)

ffmpeg -i intput.aac -vn -acodec ac3 -ac 6 -ar 48000 -ab 448k

AC3 to M4V (Mux to be opened and edited in other appz)

ffmpeg -i input.ac3 -vn -acodec copy output.m4v

AC3 to AAC (not working as expected)

ffmpeg -i input.ac3 -vn -r 30000/1001 -acodec libfaac -ac 6 -ar 48000 -ab 448k output.aac


AC3 5.1 Channel Mapping Fix

eac3to true_hd.ac3 fixed_true_hd.ac3 -blu-ray -448

AAC to AC3

  1. Open AAC on Audacity or SoundBooth
  2. Export to Wav
  3. Remux from Wav to Wav with FFmpeg:ffmpeg -i audio.wav â€"vn -acodec copy audio-out.wav
  4. Convert to AC3 with EAC3toeac3to.exe audio.wav Main.ac3 -448

Other FFmpeg Options

-threads thread count
-y overwrite output files
-ss time_off set the start time offset
-t duration record or transcode "duration" seconds of audio/video
-ildct Interlaced


《素女经》强调, 房事和人的身体强弱是相互影响的, “凡人之所以衰微者, 皆伤于阴阳交接之道尔”。提出了初步的优生道理, 强调“爱乐”是两房事合的目的, 也是为要生育“贤良而长寿”的子女。首先提出“九殃”, 即在九种情况下不宜房事, 同时也提出了如何易于怀孕。,


素女经(中国古代房事养生宝典) (AppStore Link) 素女经(中国古代房事养生宝典)
Developer: Aihua Sun
Rated: 17+
Price: $9.99 Download


QMessenger is a powerful group SMS text message and group email sender.
QMessenger provide the simple and clear contacts management.


*Send group SMS with English and Chinese template
*Send group Email with English and Chinese template
*Select multi phone or email in a contact
*Add new contact
*Browse and edit contact
*WYSIWYG contacts management
*Simple and easy searching function
*Provide phone to name search
*Show contacts' name, phone number, email in one row

QMessenger (AppStore Link) QMessenger
Developer: Aihua Sun
Rated: 4+
Price: $2.99 Download




超级特工是一款隐蔽拍摄的工具。偷拍利器, 请勿用于非法用途。