Skip to content

Instantly share code, notes, and snippets.

@yeshengwu
yeshengwu / README.md
Created February 2, 2021 08:00 — forked from gabrielemariotti/README.md
A SectionedGridRecyclerViewAdapter: use this class to realize a simple sectioned grid `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned grid RecyclerView.Adapter without changing your code.

Screen

The RecyclerView has to use a GridLayoutManager.

This is a porting of the class SimpleSectionedListAdapter provided by Google

If you are looking for a sectioned list RecyclerView.Adapter you can take a look here

public class TestSync {
public synchronized void run1() {
for (int i = 0; i < 10; i++) {
System.out.println("execute run1");
try {
private Context mContext;
public void setContext(Context context) {
mContext = context;
createfile();
}
private BufferedOutputStream outputStream;
private void createfile() {
String path = Environment.getExternalStorageDirectory().getAbsolutePath() + SystemClock.elapsedRealtime() + ".h264";
File file = null;
@yeshengwu
yeshengwu / ECDSA-secp256k1-example.java
Created December 14, 2018 13:31 — forked from nakov/ECDSA-secp256k1-example.java
ECDSA with secp256k1 in Java: generate ECC keys, sign, verify
import org.bouncycastle.util.encoders.Hex;
import org.web3j.crypto.*;
import java.math.BigInteger;
public class ECCExample {
public static String compressPubKey(BigInteger pubKey) {
String pubKeyYPrefix = pubKey.testBit(0) ? "03" : "02";
String pubKeyHex = pubKey.toString(16);
String pubKeyX = pubKeyHex.substring(0, 64);
@yeshengwu
yeshengwu / CircularQueue.h
Created September 2, 2016 07:12 — forked from werediver/CircularQueue.h
Simple implementation of circular queue in Objective-C (for ARC-enabled environment).
//
// CircularQueue.h
//
// Created on 9/21/13.
//
#import <Foundation/Foundation.h>
@interface CircularQueue : NSObject <NSFastEnumeration>
@yeshengwu
yeshengwu / public video test url
Last active November 2, 2018 15:01
sometimes find public test video url cost times
m3u8:
http://live.hkstv.hk.lxdns.com/live/hks/playlist.m3u8
http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8
mp4
rtsp://mpv.cdn3.bigCDN.com:554/bigCDN/definst/mp4:bigbuckbunnyiphone_400.mp4
http://0.s3.envato.com/h264-video-previews/80fad324-9db4-11e3-bf3d-0050569255a8/490527.mp4
https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4