JavaScript 实现 String format with ${}

JavaScript 实现 String format with ${}

1
2
3
4
5
6
7
8
9
function str_format(str, replacements) {
return str.replace(/\$\{\w+\}/g, function(placeholderWithDelimiters) {
var placeholderWithoutDelimiters = placeholderWithDelimiters.substring(2, placeholderWithDelimiters.length - 1);
var stringReplacement = replacements[placeholderWithoutDelimiters] || placeholderWithDelimiters;
return stringReplacement;
});
}
console.log(str_format('${name} is cat', {name: 'tom'}))
console.log(str_format('${0} is cat', ['tom']))

查看更多

安装PaddleSpeech

安装PaddleSpeech

前提条件

python: 3.8.10

1
pip install paddlepaddle==2.4.2

安装PaddleSpeech

1
2
3
4
5
git clone -b r1.2 https://gitee.com/paddlepaddle/PaddleSpeech
cd PaddleSpeech
pip install pytest-runner -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install . -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install uvicorn==0.18.3

查看更多

如何检查项目中用到的License

如何检查项目中用到的License

检查项目中用到的License

添加依赖

1
2
3
4
5
6
7
8
9
10
11
12
<dependencies>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.11.3</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
</dependency>
</dependencies>

查看更多

Frida获取微信消息内容

Frida获取微信消息内容

上一篇讲解了如何安装Frida

获取微信消息内容

1
2
3
4
5
6
7
var SQLiteDatabase = Java.use("com.tencent.wcdb.database.SQLiteDatabase");
SQLiteDatabase["insert"].implementation = function (str, str2, contentValues) {
console.log('SQLiteDatabase.insert is called:', 'str=', str, 'str2=', str2, 'contentValues=', contentValues);
var result = this["insert"](str, str2, contentValues);
console.log('SQLiteDatabase.insert result=', result);
return result;
};

查看更多