在build.gradle这个文件中:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9.+'
}
}
在build.gradle这个文件中:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9.+'
}
}
If you use add file add some files in your project. You can access them like this:
NSError *error;
NSString *filepath = [[NSBundle mainBundle] pathForResource:@"hello" ofType:@"txt"]; // I add __hello.txt__ into my project.
NSString *filecontent = [NSString stringWithContentsOfFile:filepath encoding:NSUTF8StringEncoding error:&error];
NSLog(@" content: %@", filecontent);
| { | |
| "name": "rando", | |
| "version": "0.6.1", | |
| "description": "random generator", | |
| "main": "rando.js", | |
| "bin": { | |
| "rando": "bin/rando.js" | |
| }, | |
| "engines": [ | |
| "node >= 0.8.0" |
convert a string to number at JavaScript.
+'12'; // 12
typeof +'12' // number
+'12s'; // NaN
typeof +'12s'; // number| // ---------------------------------------------------------- | |
| // A short snippet for detecting versions of IE in JavaScript | |
| // without resorting to user-agent sniffing | |
| // ---------------------------------------------------------- | |
| // If you're not in IE (or IE version is less than 5) then: | |
| // ie === undefined | |
| // If you're in IE (>=5) then you can determine which version: | |
| // ie === 7; // IE7 | |
| // Thus, to detect IE: | |
| // if (ie) {} |