时间:2023-06-09 13:15:02 | 来源:网站运营
时间:2023-06-09 13:15:02 来源:网站运营
《HelloGitHub》第 34 期:兴趣是最好的老师,HelloGitHub 就是帮你找到兴趣!
以下为本期内容|每个月 28 号发布最新一期|点击查看往期内容
sqler -config=path to config file
,配置示例:adduser {// 参数校验 validators { user_name_is_empty = "$input.user_name && $input.user_name.trim().length > 0" user_email_is_empty = "$input.user_email && $input.user_email.trim(' ').length > 0" user_password_is_not_ok = "$input.user_password && $input.user_password.trim(' ').length > 5" } bind { name = "$input.user_name" email = "$input.user_email" password = "$input.user_password" } methods = ["POST"]// 权限校验 authorizer = <<JS (function(){ log("use this for debugging") token = $input.http_authorization response = fetch("http://requestbin.fullcontact.com/zxpjigzx", { headers: { "Authorization": token } }) if ( response.statusCode != 200 ) { return false } return true })() JS exec = <<SQL INSERT INTO users(name, email, password, time) VALUES(:name, :email, :password, UNIX_TIMESTAMP()); SELECT * FROM users WHERE id = LAST_INSERT_ID(); SQL}
3、color:Golang 的命令行色彩使用库。拥有丰富的色彩渲染输出、通用的 API 方法、兼容 Windows 系统util
模块,后来慢慢积累并加入更多非业务相关工具类方法。经过整理修改,最终形成丰富的开源工具集。示例代码:int a = 1;//aStr为"1"String aStr = Convert.toStr(a);
8、android-viabus-architecture:一款响应式架构。借助总线转发数据的请求和响应,实现 UI、业务的完全解耦<script src="path/to/vconsole.min.js"></script><script> // init vConsole var vConsole = new VConsole(); console.log('Hello world');</script>
import { render, WeElement, define } from 'omi'define('my-counter', class extends WeElement { static observe = true data = { count: 1 } sub = () => { this.data.count-- } add = () => { this.data.count++ } render() { return ( <div> <button onClick={this.sub}>-</button> <span>{this.data.count}</span> <button onClick={this.add}>+</button> </div> ) } })render(<my-counter ></my-counter>, 'body')
12、RSSHub:轻量、易于扩展的 RSS 生成器,可以给任何奇奇怪怪的内容生成 RSS 订阅源。现已支持丰富的源,详情见文档<html><head> <title>Demo - Axial3d</title></head><body> <script src="https://unpkg.com/axial3d"></script> <div id="axial3d"></div> <script> (function () { var options = { selector: '#axial3d', imgs: [ {src: 'https://bestvist.github.io/axial3d/public/demo1/bg.png', left: '50px', top: '10px'}, {src: 'https://bestvist.github.io/axial3d/public/demo1/2.png', left: '150px', top: '10px'}, {src: 'https://bestvist.github.io/axial3d/public/demo1/3.png', left: '50px', top: '300px'}, {src: 'https://bestvist.github.io/axial3d/public/demo1/4.png', left: '300px', top: '300px'} ] } var effect = new Axial3d(options); })() </script></body></html>
16、giojs:基于 Three.js 的 Web 3D 地球数据可视化的开源组件库。使用 Gio.js 的网页应用开发者,可以快速地以申明的方式创建自定义的 Web3D 数据可视化模型,添加数据,并且将其作为一个组件整合到自己的应用中。支持静态 Dom、React和微信小程序。具有一下特点: - 易用性 -- 仅使用 4 行 Javascript 即可创建 3D 地球数据可视化模型 - 定制化 -- 使用 Gio.js 提供的丰富的 API 来创建自定义样式的 3D 地球 - 现代化 -- 基于 Gio.js 构建高交互、跨平台、自适应的现代化 3D 前端应用import click@click.command()@click.option("--count", default=1, help="Number of greetings.")@click.option("--name", prompt="Your name", help="The person to greet.")def hello(count, name): """Simple program that greets NAME for a total of COUNT times.""" for _ in range(count): click.echo("Hello, %s!" % name)if __name__ == '__main__': hello()# 下面为运行效果$ python hello.py --count=3Your name: ClickHello, Click!Hello, Click!Hello, Click!
22、PSpider:代码量极少,功能却很完备的 Python 爬虫框架。特点: - 功能完备:包含抓取、解析、存储等 - 代码量少:方便阅读源码、动手修改、二次开发 - 等等import torchfrom pytorch_pretrained_bert import BertTokenizer, BertModel, BertForMaskedLM# Load pre-trained model tokenizer (vocabulary)tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')# Tokenized inputtext = "Who was Jim Henson ? Jim Henson was a puppeteer"tokenized_text = tokenizer.tokenize(text)# Mask a token that we will try to predict back with `BertForMaskedLM`masked_index = 6tokenized_text[masked_index] = '[MASK]'assert tokenized_text == ['who', 'was', 'jim', 'henson', '?', 'jim', '[MASK]', 'was', 'a', 'puppet', '##eer']# Convert token to vocabulary indicesindexed_tokens = tokenizer.convert_tokens_to_ids(tokenized_text)# Define sentence A and B indices associated to 1st and 2nd sentences (see paper)segments_ids = [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1]# Convert inputs to PyTorch tensorstokens_tensor = torch.tensor([indexed_tokens])segments_tensors = torch.tensor([segments_ids])
32、RecommenderSystem-Paper:推荐系统论文整理列表,包括了行业顶尖会议 AAAI、NIPS 等发表的论文,以及 KDD 一些获奖论文。方便推荐系统方向以及文本表示方向等研究人员,跟踪阅读行业内经典论文和最新研究方向关键词: