Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Yuan juntao

View GitHub Profile
View tensorflow_inference_2.rs
let labels = include_str!("aiy_food_V1_labelmap.txt");
let mut i = 0;
let mut max_index: i32 = -1;
let mut max_value: u8 = 0;
while i < res_vec.len() {
let cur = res_vec[i];
if cur > max_value {
max_value = cur;
max_index = i as i32;
View tensorflow_inference_1.rs
// Load the model data from a file
let model_data: &[u8] = include_bytes!("lite-model_aiy_vision_classifier_food_V1_1.tflite");
// Read the input image data from Tencent Cloud's API gateway
let mut buffer = String::new();
io::stdin().read_to_string(&mut buffer).expect("Error reading from STDIN");
let obj: FaasInput = serde_json::from_str(&buffer).unwrap();
let img_buf = base64::decode_config(&(obj.body), base64::STANDARD).unwrap();
// Resize the image to the size needed by the Tensorflow model
@juntao
juntao / main.yml
Created Mar 23, 2020
The .github/workflows/main.yml file for Arenztopia.com
View main.yml
name: github pages
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1 # v2 does not have submodules option now
View # 武汉肺炎 2020
Add the following to "dapp -- Resources"
* JavaScript: https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js
* CSS: https://cdn.bootcss.com/twitter-bootstrap/3.3.7/css/bootstrap.min.css
<p>2020鼠年的春节,我们都不得不待在家里。从开始一句句给我女儿徐笑笑讲述“病毒”“肺炎”,让她理解不能带她去广州玩儿了,到一点点渗透“可能有很长一段时间都不能出门,不能上幼儿园了”……</p>
<p>我想肯定有很多家长,像我一样,努力地向小朋友们解释着发生着的一切;也肯定有很多家长,不知道怎么向小朋友们科学、系统、有效的解释为什么突然就不能出门了。</p>
<p>感谢我身边的朋友们,一起制作了这个18页的中英双语绘本。家长们可以用这个生动形象的绘本,向小朋友解释:新型冠状病毒的传播途径、为什么会出现新型冠状病毒、出门时必须戴口罩、回家必须7步洗手。</p>
@juntao
juntao / # SIG 2019
Last active Dec 14, 2019
# SIG 2019
View # SIG 2019
Add the following to "dapp -- Resources"
* JavaScript: https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js
* CSS: https://cdn.bootcss.com/twitter-bootstrap/3.3.7/css/bootstrap.min.css
The "dapp -- CSS" should be empty
https://opendapps.secondstate.io/SIG2019_1576286389667.html
<p>欢迎参加2019海纳亚洲大会!请各位嘉宾在下方输入名字领取 Addison-Wesley 新出版的 <a href="https://www.amazon.com/Building-Blockchain-Apps-Michael-Yuan/dp/0135172322/">Buidling Blockchain App</a> 一书</p><p><center><img width="320px" src="https://blog.secondstate.io/images/20191002-book-etc-01.png"></center></p>
View # 普华
Add the following to "dapp -- Resources"
* JavaScript: https://code.jquery.com/jquery-3.4.1.min.js
* CSS: https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css
The "dapp -- CSS" should be empty
https://opendapps.secondstate.io/2019_1574356829918.html
<p>欢迎参加2019普华科技大会!</p><p><center><img width="320px" src="https://www.secondstate.io/demo/2019-puhua.jpg"></center></p><p>请各位嘉宾在下方输入名字签到</p>
View # 天津大学 11-19 如何快速入门区块链开发
Add the following to "dapp -- Resources"
* JavaScript: https://code.jquery.com/jquery-3.4.1.min.js
* CSS: https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css
The "dapp -- CSS" should be empty
View # Vote up or down
Add the following to "dapp -- Resources"
* JavaScript: https://code.jquery.com/jquery-3.4.1.min.js
* CSS: https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css
The "dapp -- CSS" should be empty
View gist:cc1565b76949a6bbd8bfb15aa9e53dc8
pragma lity ^1.2.4;
contract Human {
address public owner;
modifier onlyOwner() {
assert(msg.sender == owner);
_;
}
View keybase.md

Keybase proof

I hereby claim:

  • I am juntao on github.
  • I am juntao (https://keybase.io/juntao) on keybase.
  • I have a public key ASAFVjl9VGERabkbF0LqejQwAth1vfjLsvgduFCpzXWc-wo

To claim this, I am signing this object: