⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---------------------------------------------------------- | |
// 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) {} |
convert a string to number at JavaScript.
- +
+'12'; // 12
typeof +'12' // number
+'12s'; // NaN
typeof +'12s'; // number
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "rando", | |
"version": "0.6.1", | |
"description": "random generator", | |
"main": "rando.js", | |
"bin": { | |
"rando": "bin/rando.js" | |
}, | |
"engines": [ | |
"node >= 0.8.0" |
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);
在build.gradle这个文件中:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9.+'
}
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-injars bin/classes | |
-injars libs | |
-outjars bin/classes-processed.jar | |
-libraryjars /usr/local/java/android-sdk/platforms/android-9/android.jar | |
-dontpreverify | |
-repackageclasses '' | |
-allowaccessmodification | |
-optimizations !code/simplification/arithmetic | |
-keepattributes *Annotation* |
We ran into a problem when leaving the activity. WebView will display the following message in logcat:
EventHub.removeMessages(int what = 107) is not supported before WebViewCore is set up
To prevent this message from showing up use WebView stopLoading() method:
// !!! This method is wrong!
// !!! Do not solve problem
@Override
public void onStop() {
At Activity:
//...
webView.getSettings().setUserAgentString("CUSTOM_USE_AGENT");
//...
OlderNewer