Jan 28, 2012

command used to check if processor is 64bit

grep --color=always -iw lm /proc/cpuinfo

Jun 25, 2011

apache and htaccess

1. in your Directory

DirectoryIndex index.php index.html
Options Indexes FollowSymLinks MultiViews
AllowOverride All ##### this should be All
Order allow,deny
allow from all


2. in your /var/www/xxx folder, add file .htaccess
Options +FollowSymLinks
IndexIgnore */*

RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php

Jun 11, 2011

Cocos2D Complete

■CCLabelTTF Font List:
  List of iOS Fonts available in iOS 3.1 and above
  • Family name: AppleGothic
  • Font name: AppleGothic
  • Family name: Hiragino Kaku Gothic ProN
  • Font name: HiraKakuProN-W6
  • Font name: HiraKakuProN-W3
  • Family name: Arial Unicode MS
  • Font name: ArialUnicodeMS
  • Family name: Heiti K
  • Font name: STHeitiK-Medium
  • Font name: STHeitiK-Light
  • Family name: DB LCD Temp
  • Font name: DBLCDTempBlack
  • Family name: Helvetica
  • Font name: Helvetica-Oblique
  • Font name: Helvetica-BoldOblique
  • Font name: Helvetica
  • Font name: Helvetica-Bold
  • Family name: Marker Felt
  • Font name: MarkerFelt-Thin
  • Family name: Times New Roman
  • Font name: TimesNewRomanPSMT
  • Font name: TimesNewRomanPS-BoldMT
  • Font name: TimesNewRomanPS-BoldItalicMT
  • Font name: TimesNewRomanPS-ItalicMT
  • Family name: Verdana
  • Font name: Verdana-Bold
  • Font name: Verdana-BoldItalic
  • Font name: Verdana
  • Font name: Verdana-Italic
  • Family name: Georgia
  • Font name: Georgia-Bold
  • Font name: Georgia
  • Font name: Georgia-BoldItalic
  • Font name: Georgia-Italic
  • Family name: Arial Rounded MT Bold
  • Font name: ArialRoundedMTBold
  • Family name: Trebuchet MS
  • Font name: TrebuchetMS-Italic
  • Font name: TrebuchetMS
  • Font name: Trebuchet-BoldItalic
  • Font name: TrebuchetMS-Bold
  • Family name: Heiti TC
  • Font name: STHeitiTC-Light
  • Font name: STHeitiTC-Medium
  • Family name: Geeza Pro
  • Font name: GeezaPro-Bold
  • Font name: GeezaPro
  • Family name: Courier
  • Font name: Courier
  • Font name: Courier-BoldOblique
  • Font name: Courier-Oblique
  • Font name: Courier-Bold
  • Family name: Arial
  • Font name: ArialMT
  • Font name: Arial-BoldMT
  • Font name: Arial-BoldItalicMT
  • Font name: Arial-ItalicMT
  • Family name: Heiti J
  • Font name: STHeitiJ-Medium
  • Font name: STHeitiJ-Light
  • Family name: Arial Hebrew
  • Font name: ArialHebrew
  • Font name: ArialHebrew-Bold
  • Family name: Courier New
  • Font name: CourierNewPS-BoldMT
  • Font name: CourierNewPS-ItalicMT
  • Font name: CourierNewPS-BoldItalicMT
  • Font name: CourierNewPSMT
  • Family name: Zapfino
  • Font name: Zapfino
  • Family name: American Typewriter
  • Font name: AmericanTypewriter
  • Font name: AmericanTypewriter-Bold
  • Family name: Heiti SC
  • Font name: STHeitiSC-Medium
  • Font name: STHeitiSC-Light
  • Family name: Helvetica Neue
  • Font name: HelveticaNeue
  • Font name: HelveticaNeue-Bold
  • Family name: Thonburi
  • Font name: Thonburi-Bold
  • Font name: Thonburi

May 27, 2011

iOS4.2 Bug with UINavigationViewController

Everytime when I left the top view, I set the topView's title to @"TOP";
When I came back to the TOP, I would set the topView's title to @"", for that I had a backgroud image to be displayed as the title.
The problem was, with iOS4.2,the second time I left TOP view controller and went to a second level view controller, the back item in the NavigationBar disappeared.
"DISAPPEARED"!!!!!!!!!有木有!!!!!!!!!
I couldn't go back to the TOP!!!!!!!!!!!!!!
I got rejected by GREE for this f**king problem!!!!!!!

But, there's always a but!
I love but(this statement is still true by replacing the t with a double t)!

I came out with a solution.

1. set the top's title to @"TOP", don't set it back to @"";
2. every time you go back to the top , do this:
self.navigationItem.titleView = [[UIView alloc] initWithFrame:CGRectMake(0,0,1,1)];

Now, the problem disappeard!!!!
"DISAPPEARED"!!!!!!!!!有木有!!!!!!!!!

May 25, 2011

Weird problem with CCSprite

I added a CCSprite(with an image) as the background, the fps jumped to 30.0.
when I remove it or change the scale to less than 1.0, the fps would return to 60.0.
Now I am going to find out what's going on here.

Apr 14, 2011

Iphone Code Complete

1. how to count time.

CFAbsoluteTime time = CFAbsoluteTimeGetCurrent();


beware that the CFAbsoluteTime is a Double.


2. How to open a URL

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"your url here"]];



Apr 2, 2011

install ssh on ubuntu

I didn't use apt for a long time, so...first I updated apt...

> apt-get update

then,
> apt-get install openssh-server

after ssh get installed..

> /etc/init.d/ssh start

done!!
pretty simple, right?