$ svn log --xml | grep author | sort -u | perl -pe 's/.>(.?)<./$1 = /'
手动设置对应关系 users.txt
function dex-method-count() { | |
cat $1 | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"' | |
} | |
function dex-method-count-by-package() { | |
dir=$(mktemp -d -t dex) | |
baksmali $1 -o $dir | |
for pkg in `find $dir/* -type d`; do | |
smali $pkg -o $pkg/classes.dex | |
count=$(dex-method-count $pkg/classes.dex) | |
name=$(echo ${pkg:(${#dir} + 1)} | tr '/' '.') |
from xml.etree import ElementTree as ET | |
import glob | |
import sys | |
import os | |
class ManifestMerger(object): | |
def __init__(self, app_manifest, filenames): | |
assert len(filenames) > 0, 'No filenames!' | |
ET.register_namespace("android", "http://schemas.android.com/apk/res/android") | |
print app_manifest |
private List<WeakReference<IFileDownloader.IFileDownloadCallBack> > callbackList | |
= Collections.synchronizedList(new ArrayList<WeakReference<IFileDownloader.IFileDownloadCallBack>>()); | |
public void addCallback(IFileDownloader.IFileDownloadCallBack cb) { | |
if (cb != null) { | |
for (int i=0; i < callbackList.size(); ++i) { | |
IFileDownloader.IFileDownloadCallBack callback = callbackList.get(i).get(); | |
if (callback == cb) { | |
return; | |
} |
public class Main { | |
public static void main(String[] args) { | |
try { | |
System.out.println(encrypt("12345678", "abc", "12345678")); | |
System.out.println(encrypt("12345678", "ABC", "12345678")); | |
System.out.println(decrypt("12345678", "9YR6ZPdZufM=", "12345678")); | |
System.out.println(decrypt("12345678", "6rtTnrF34mPkJ5SO3RiaaQ==", "12345678")); |
(by @andrestaltz)
So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.
Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:
Rx.Observable.prototype.flatMapLatest(selector, [thisArg])
Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
Android插件化 | |
=================== | |
[TOC] | |
Proguard | |
------------------- | |
proguard是原生支持keepmapping的,可以直接导入一个mapping文件,保证混淆的一致性,但是我当时做犯了一个错误,就是试图保证所有的mapping文件都一致,但是proguard混淆函数的算法是顺序的,后续导致会有不可避免的冲突发生。现在我想到有2种方法可以避免这个发生: | |
1. 更改proguard函数生成算法,用更长的签名来做作用域,给每个命名空间留出足够的空间来填充增加的函数; | |
2. 抽象出sdk类函数,保证这一部分函数的对下一致。不保证插件函数可以keep。 |
private class MyWebChromeClient extends WebChromeClient { | |
private Bitmap mDefaultVideoPoster; | |
private View mVideoProgressView; | |
@Override | |
public void onShowCustomView(View view, WebChromeClient.CustomViewCallback callback) | |
{ | |
//Log.i(LOGTAG, "here in on ShowCustomView"); | |
HTML5WebView.this.setVisibility(View.GONE); | |
class Singleton(type): | |
def __init__(cls, name, bases, dict): | |
super(Singleton, cls).__init__(name, bases, dict) | |
cls.instance = None | |
def __call__(cls, *args, **kw): | |
if cls.instance is None: | |
cls.instance = super(Singleton, cls).__call__(*args, **kw) | |
return cls.instance |
failed (104: Connection reset by peer) while reading response header from upstream, client: | |
If you are getting the above error in nginx logs running in from of upstream servers you may consider doing this as it worked for me: | |
check the ulimit on the machines and ensure it is high enough to handle the load coming in. 'ulimit' on linux, I am told determines the maximum number of open files the kernel can handle. | |
The way I did that? | |
modifying limits: for open files: | |
-------------------------------- | |
add or change this line in /etc/systcl.conf | |
fs.file-max = <limit-number> |