git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
# 中国身份证校验码计算公式 | |
# for more information: http://blog.sciencenet.cn/blog-408109-1075697.html | |
# 使用方法: | |
# `id_calculator ${身份证号码空格隔开}` | |
# 例如: | |
# ``` | |
# $ id_calculator 1 1 0 1 0 0 2 0 0 1 0 9 1 0 8 2 9 1 | |
# $ 求和 = 209, 余数 = 0, 校验码 = 1 |
PmHostSvc:IPluginHost | |
===================== | |
@Override | |
public Map<String, List<String>> queryLocalBroadcasts(String action, boolean hostOnly) throws RemoteException { | |
if (LogDebug.LOG) { | |
LogDebug.d("IPluginHost", String.format("queryLocalBroadcasts(%s): >>>>>> ", action)); | |
} | |
final long start = LogDebug.LOG ? System.currentTimeMillis() : 0; | |
// |
pragma solidity ^0.4.23; | |
library Math { | |
function add(uint256 x, uint256 y) pure internal returns (uint256 z) { | |
assert((z = x + y) >= x); | |
} | |
function sub(uint256 x, uint256 y) pure internal returns (uint256 z) { | |
assert((z = x - y) <= x); |
task hello(){ | |
println("HELLO") | |
} | |
task deployReplugin { | |
println("deployReplugin") | |
} | |
deployReplugin.doLast { | |
println("deployReplugin.doLast") |
// Way 1 | |
def loadConfig; loadConfig = { p -> | |
if (p == null || !p.exists()) return | |
if (new File(p, "rp-config.gradle").exists()) apply from: "${p}/rp-config.gradle" | |
else loadConfig(p.parentFile) | |
} | |
loadConfig(buildscript.sourceFile.parentFile) | |
// Way2 | |
def loadConfig = { p -> |
".cloudfront.net", | |
"||cloudfront.net", |
by alexander white ©
如果应用的minSdkVersion小于21,可能多数的Instant Run功能会挂掉,这里提供一个解决方法,通过product flavor建立一个minSdkVersion大于21的新分支,用来debug。 |
```Java | |
private Bitmap getFullResIcon(String packageName) throws PackageManager.NameNotFoundException { | |
return getFullResIcon(pm.getApplicationInfo(packageName, 0)); | |
} | |
private Bitmap getFullResIcon(ApplicationInfo info) { | |
try { | |
Resources resources = pm.getResourcesForApplication(info.packageName); | |
if (resources != null) { |