04 2013 档案
摘要:1. Run the shell $ sh script.sh # Assuming script is in the current directory. Or: $ sh /home/path/script.sh # Using full path of script.sh. #讲脚本改为可执行模式 $ chmod a+x script.sh $ ./script.sh #./ represents the current directory Or: $ /home/path/script.sh # Full path of the script is used
阅读全文
摘要:自定义类如下:import mathclass Circle: # Construct a circle object def __init__(self, radius = 1): self.radius = radius def getPerimeter(self): return 2 * self.radius * math.pi def getArea(self): return self.radius * self.radius * math.pi def setRadius(self, ...
阅读全文
摘要:1. Strings1) 简单字符串NSString *aString = @"this is a string";NSString *anotherString = @"and this is another one";2) 对象初始化NSString *aString = [[NSString alloc] initWithString:@"some string literal"];NSString *aString = [NSString stringWithString:@"some string literal&
阅读全文
摘要:1. Strings1) 简单字符串NSString *aString = @"this is a string";NSString *anotherString = @"and this is another one";2) 对象初始化NSString *aString = [[NSString alloc] initWithString:@"some string literal"];NSString *aString = [NSString stringWithString:@"some string literal&
阅读全文
摘要:#import <Foundation/Foundation.h>// --------------------------------------------------@interface Tire : NSObject@end // Tire@implementation Tire- (NSString *) description{ return (@"I am a tire. I last a while");} // description@end // Tire// -----------------------------------------
阅读全文
摘要:#import <Foundation/Foundation.h>// --------------------------------------------------// constants for the different kinds of shapes and their colorstypedef enum { kRedColor, kGreenColor, kBlueColor} ShapeColor;// --------------------------------------------------// Shape bounding rectangle...
阅读全文
摘要:1.In Xcode, choose Product-> Edit Scheme and then click the Arguments tab2As shown in the following screen shot, click the plus sign in the Arguments Passed On Launch section, andtype the launch argument—in this case, the path to the words.txt file
阅读全文