Install Multiple Python Versions for Specific Project
-
Home project: https://github.com/pyenv/pyenv
-
Reference to: https://www.tecmint.com/pyenv-install-and-manage-multiple-python-versions-in-linux/
/** | |
* 原生API的aes-128-ctr加密算法, | |
* 参数统一使用UnitArray, 加密过程不限于字符串, 浏览器与node端通用 | |
* 使用node的crypto模块与浏览器的window.crypto对象, | |
* IV长度固定为16, | |
* 浏览器不支持aes-256, 故使用aes-128, key长度固定为16, | |
*/ | |
const str2uint = str => new TextEncoder("utf8").encode(str); | |
const uint2str = bf => new TextDecoder("utf8").decode(bf); |
Install Multiple Python Versions for Specific Project
Home project: https://github.com/pyenv/pyenv
Reference to: https://www.tecmint.com/pyenv-install-and-manage-multiple-python-versions-in-linux/
First of all, get prepared by installing the Android SDK and SDK tools in order to get the adb
executable. Then:
adb connect <device ip>
To get the service name `adb shell "cat /proc/net/unix | grep devtools_remote", which will give you something like this output:
00000000: 00000002 00000000 00010000 0001 01 423897 @webview_devtools_remote_18279
disable sip in recovery mode | |
start recovery mode with Cmd + R on startup | |
start terminal | |
csrutil disable | |
download and install cuda 8 | |
download cuDNN v6.0 for cuda 8 (register first) | |
install xcode 7.2 | |
current xcode version is not supported |
#build.gradle | |
# | |
# compile 'io.reactivex:rxandroid:1.0.1' | |
# compile 'io.reactivex:rxjava:1.0.14' | |
# compile 'io.reactivex:rxjava-math:1.0.0' | |
# compile 'com.jakewharton.rxbinding:rxbinding:0.2.0' | |
# rxjava | |
-keep class rx.schedulers.Schedulers { | |
public static <methods>; |
Android Recyclerview GridLayoutManager column spacing Here is the question, the first answer does not work well in my project,and it makes the spacing bigger between item and item. the second answer is quite perfect.But if RecyclerView has headers,it does not work well. Then I fixed it.
import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;
/**
/** | |
* Module that includes this will be configured to use offline dependencies for Robolectric | |
* This downloads robolectric dependencies once into the root project | |
*/ | |
def robolectricDependenciesFolder = rootProject.buildDir.path + "/robolectric-dependencies" | |
// configuration that resolves Robolectric runtime dependencies | |
configurations.create('robolectricRuntime') |
/** | |
* Custom Scroll listener for RecyclerView. | |
* Based on implementation https://gist.github.com/ssinss/e06f12ef66c51252563e | |
*/ | |
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener { | |
public static String TAG = "EndlessScrollListener"; | |
private int previousTotal = 0; // The total number of items in the dataset after the last load | |
private boolean loading = true; // True if we are still waiting for the last set of data to load. | |
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more. |
import android.support.v7.widget.LinearLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener { | |
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName(); | |
private int previousTotal = 0; // The total number of items in the dataset after the last load | |
private boolean loading = true; // True if we are still waiting for the last set of data to load. | |
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more. | |
int firstVisibleItem, visibleItemCount, totalItemCount; |