Forwarded from shortybin
问个问题 组件化 假如组建A调用组建B的播放功能,组建B里面的播放器暂停后,怎么把回调发送到组建A
Forwarded from SuperMarioSF | Trust Platform Builder (?)
你只杀掉那个名为system_server的那个zygote进程就足够了(
Forwarded from Ninos Roger
image_2020-09-15_16-53-57.png
5 KB
官方给的BottomNavigationView+Fragment的demo,Fragment没法复用,各位有没有在保持官方写法思路上让fragment页面复用
Forwarded from Ninos Roger
image_2020-09-15_16-55-15.png
44.8 KB
Forwarded from Nico Ranshi
dumpsys telephony.registry |grep mServiceState|grep nrState=CONNECTED
Forwarded from 螺莉莉的黑板报
【提醒】node-gyp 的官方文档是错误的,通过这份文档您无法完成部分二进制依赖的编译工作。
正确的做法为:
1. 安装 VS Code 2019 Community 和 Desktop Development with C++ 扩展
2. 安装 Python 3.8 非商店版本
3. 执行下列命令:
向 node-gyp 开发团队致以诚挚的祖安。
正确的做法为:
1. 安装 VS Code 2019 Community 和 Desktop Development with C++ 扩展
2. 安装 Python 3.8 非商店版本
3. 执行下列命令:
npm config set msvs_version 2019
npm config set msbuild_path "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe"
向 node-gyp 开发团队致以诚挚的祖安。
Forwarded from ffmpeg eats swap
string SHA256(string str)
{
unsigned char hashRaw[32];
char buf[128] = "";
SHA256_CTX sha256;
SHA256_Init(&sha256);
SHA256_Update(&sha256, str.c_str(), str.size());
SHA256_Final(hashRaw, &sha256);
for (int i = 0; i < 32; ++i)
sprintf((buf + (i << 1)), "%02x", hashRaw[i]);
return string(buf);
}
int maxLength, cnt;
char tmp[10240];
vector<strHash> s;
void dfs(int depth = 0)
{
if (depth >= maxLength)
return;
for (int i = 1; i < 256; ++i)
{
tmp[depth] = i;
s.push_back(strHash{string(str), SHA256(string(str))});
dfs(depth + 1);
tmp[depth] = 0;
}
}
Forwarded from CSharp.Lang
/**
* private: 產生未經 Hash 的字串列表
*
* @param {int} maxLen 最多要產生幾個字串?
* @param {int} range 字元的範圍,預設為 256 即 ASCII 字元範圍。
* @return 字串列表
*/
function _genStrList (maxLen, range = 256) {
let strings
if (strings.length <= 0) {
for (let charCode = 0; charCode != range; charCode++) {
if (strings.length >= maxLen) return strings
strings.push(String.fromCharCode(charCode))
}
}
while (true) {
for (let str of strings) {
for (let charCode = 0; charCode != range; charCode++) {
if (strings.length >= maxLen) return strings
strings.push(str + String.fromCharCode(charCode))
}
}
}
}
/**
* 產生彩虹表
*
* @param {int} len 最多要產生幾個 Hash 字串?預設為 65536 個。
* @param {int} range 字元的範圍,預設為 256 即 ASCII 字元範圍。
* @return {map} 彩虹表
*/
function genHashlist (len = 65536, range = 256) {
console.log("-> 📖 Generating Strings...")
const strings = _genStrList(len, range)
console.log("-> \n🆗 Generated Strings.")
console.log("-> 🖩 Hashing Strings...")
let hashlist = new Map()
const crypto = require('crypto')
for (const rawStr of strings) {
// 預設的 Hash 方式是 SHA256
const hash = crypto.createHash('sha256')
hash.update(rawStr, 'UTF-8')
const hashVal = hash.digest('hex').toString()
hashlist.set(hashVal, {
original: rawStr
})
console.log("-> 🖩 Hashing Strings, Now: " + hashlist.keys().length)
}
console.log("-> 🆗 Hashed Strings.")
return hashlist
}
Forwarded from ffmpeg eats swap
inline int read()
{
int n = 0, pn = 0, ch = getchar();
for (; !isdigit(ch); ch = getchar())
pn ^= (ch == '-');
for (; isdigit(ch); ch = getchar())
n = (n << 3) + (n << 1) + (ch ^ 48);
return pn ? -n : n;
}Forwarded from ffmpeg eats swap
#include <bits/stdc++.h>
#include <openssl/sha.h>
using namespace std;
// result should be a char array lengthed 32
void SHA256(char *source, unsigned char *result)
{
SHA256_CTX sha256;
SHA256_Init(&sha256);
SHA256_Update(&sha256, source, strlen(source));
SHA256_Final(result, &sha256);
}
int main()
{
unsigned char result[32];
char source[10240];
cout << "Enter information: ";
cin.getline(source, 10240);
SHA256(source, result);
for (int i = 0; i < 32; ++i)
printf("%02x", result[i]);
cout << endl;
return 0;
}