yu@librity:python Could not find platform independent libraries <prefix> Could not find platform dependent libraries <exec_prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] Python path configuration: PYTHONHOME = (not set) PYTHONPATH = (not set) program name = 'python' isolated = 0 environment = 1 user site = 1 import site = 1 sys._base_executable = '/usr/bin/python' sys.base_prefix = '/usr' sys.base_exec_prefix = '/usr' sys.executable = '/usr/bin/python' sys.prefix = '/usr' sys.exec_prefix = '/usr' sys.path = [ '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/lib-dynload', ] Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding Python runtime state: core initialized ModuleNotFoundError: No module named 'encodings'
Current thread 0x00007fc19c386740 (most recent call first): <no Python frame>
报了一堆什么 Could not find 的问题。然后我又无意间执行了这个代码 update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
1 2 3
yu@librity:~$ update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 Can not upgrade Your python install is corrupted. Please fix the '/usr/bin/python' symlink.
fundowork(){ var binderPool = BinderPool.getInstance(this) var securityBinder = binderPool.queryBinder(BinderPool.BINDER_SECURITY_CENTER) var mSecurityCenter = SecurityCenterImpl.asInterface(securityBinder) var password = mSecurityCenter.encrypt("Hellp=Android") println("encrty:${password}") println("dectypt:${mSecurityCenter.decrypy(password)}") var computeBinder = binderPool.queryBinder(BinderPool.BINDER_COMPUTER) var mComoute = ComputeImpl.asInterface(computeBinder) println("3+5=${mComoute.add(3,5)}") }
finalclassActiveResources{ final Map<Key, ResourceWeakReference> activeEngineResources = new HashMap<>(); privatefinal ReferenceQueue<EngineResource<?>> resourceReferenceQueue = new ReferenceQueue<>(); }
protectedvoidmeasureChildWithMargins(View child, int parentWidthMeasureSpec, int widthUsed, int parentHeightMeasureSpec, int heightUsed){ final MarginLayoutParams lp = (MarginLayoutParams) child.getLayoutParams();
publicstaticintgetChildMeasureSpec(int spec, int padding, int childDimension){ int specMode = MeasureSpec.getMode(spec); int specSize = MeasureSpec.getSize(spec);
int size = Math.max(0, specSize - padding);
int resultSize = 0; int resultMode = 0;
switch (specMode) { // Parent has imposed an exact size on us case MeasureSpec.EXACTLY: if (childDimension >= 0) { resultSize = childDimension; resultMode = MeasureSpec.EXACTLY; } elseif (childDimension == LayoutParams.MATCH_PARENT) { // Child wants to be our size. So be it. resultSize = size; resultMode = MeasureSpec.EXACTLY; } elseif (childDimension == LayoutParams.WRAP_CONTENT) { // Child wants to determine its own size. It can't be // bigger than us. resultSize = size; resultMode = MeasureSpec.AT_MOST; } break;
// Parent has imposed a maximum size on us case MeasureSpec.AT_MOST: if (childDimension >= 0) { // Child wants a specific size... so be it resultSize = childDimension; resultMode = MeasureSpec.EXACTLY; } elseif (childDimension == LayoutParams.MATCH_PARENT) { // Child wants to be our size, but our size is not fixed. // Constrain child to not be bigger than us. resultSize = size; resultMode = MeasureSpec.AT_MOST; } elseif (childDimension == LayoutParams.WRAP_CONTENT) { // Child wants to determine its own size. It can't be // bigger than us. resultSize = size; resultMode = MeasureSpec.AT_MOST; } break;
// Parent asked to see how big we want to be case MeasureSpec.UNSPECIFIED: if (childDimension >= 0) { // Child wants a specific size... let him have it resultSize = childDimension; resultMode = MeasureSpec.EXACTLY; } elseif (childDimension == LayoutParams.MATCH_PARENT) { // Child wants to be our size... find out how big it should // be resultSize = View.sUseZeroUnspecifiedMeasureSpec ? 0 : size; resultMode = MeasureSpec.UNSPECIFIED; } elseif (childDimension == LayoutParams.WRAP_CONTENT) { // Child wants to determine its own size.... find out how // big it should be resultSize = View.sUseZeroUnspecifiedMeasureSpec ? 0 : size; resultMode = MeasureSpec.UNSPECIFIED; } break; } //noinspection ResourceType return MeasureSpec.makeMeasureSpec(resultSize, resultMode); }
// if RecyclerView has non-exact width and height and if there is at least one child // which also has non-exact width & height, we have to re-measure. if (mLayout.shouldMeasureTwice()) { mLayout.setMeasureSpecs( MeasureSpec.makeMeasureSpec(getMeasuredWidth(), MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(getMeasuredHeight(), MeasureSpec.EXACTLY)); mState.mIsMeasuring = true; dispatchLayoutStep2(); mLayout.setMeasuredDimensionFromChildren(widthSpec, heightSpec); } } }
privatebooleanaddWorker(Runnable firstTask, boolean core){ retry: /** *这里有个双循环,外层的循环是判断线程池是否是可运行状态 *第二层循环判断线程数量是否已经超过线程数量设定。 **/ for (int c = ctl.get();;) { if (runStateAtLeast(c, SHUTDOWN) && (runStateAtLeast(c, STOP) || firstTask != null || workQueue.isEmpty())) returnfalse;
for (;;) { if (workerCountOf(c) >= ((core ? corePoolSize : maximumPoolSize) & COUNT_MASK)) returnfalse; if (compareAndIncrementWorkerCount(c)) break retry; c = ctl.get(); if (runStateAtLeast(c, SHUTDOWN)) continue retry; } }
boolean workerStarted = false; boolean workerAdded = false; Worker w = null; try { // 这里创建了Worker对象,你查看worker的构造函数, // 你会发现在构造函数里面创建了线程thread。 w = new Worker(firstTask); final Thread t = w.thread; if (t != null) { final ReentrantLock mainLock = this.mainLock; mainLock.lock(); try { int c = ctl.get();
if (isRunning(c) || (runStateLessThan(c, STOP) && firstTask == null)) { if (t.getState() != Thread.State.NEW) thrownew IllegalThreadStateException(); workers.add(w); workerAdded = true; int s = workers.size(); if (s > largestPoolSize) largestPoolSize = s; } } finally { mainLock.unlock(); } if (workerAdded) { // 开启了线程 这里很关键,哈哈。你第一次看到这里的时候一定蒙蔽, // 这里直接调用了thread.start.那核心线程是怎么一直运行下去的还不会停止? // 下面我会带你看worker类 t.start(); workerStarted = true; } } } finally { if (! workerStarted) addWorkerFailed(w); } return workerStarted; }
for (;;) { int c = ctl.get(); if (runStateAtLeast(c, SHUTDOWN) && (runStateAtLeast(c, STOP) || workQueue.isEmpty())) { decrementWorkerCount(); returnnull; }
public static ExecutorService newCachedThreadPool() { return new ThreadPoolExecutor(0, Integer.MAX_VALUE, 60L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>()); }
if (zygote) { runtime.start("com.android.internal.os.ZygoteInit", args, zygote); } elseif (className) { runtime.start("com.android.internal.os.RuntimeInit", args, zygote); } else { fprintf(stderr, "Error: no class name or --zygote supplied.\n"); app_usage(); LOG_ALWAYS_FATAL("app_process: no class name or --zygote supplied."); }