普通视图

已接收 — 2025年7月27日 山里来了攻城狮 | WILDLION

Basic example of running WebAssembly with Go

2025年7月17日 14:02
WebAssembly is a low-level, assembly-like language that brings near-native performance to browsers. WebAssembly allows developers to code in their familiar programming languages such as C/C++, Rust, Go, Python, and so on. The code is then compiled into the wasm binary format and can be executed in browsers . WebAssembly was first released in 2017 and … Continue reading Basic example of running WebAssembly with Go

mmap – an effective way of reading/writing large files

2025年7月15日 23:53
When operating with files in programming, we often read entire file content into physical memory. While writing the code doesn’t take much time, what happens behind the scenes is far more complex. During the process, your program has to invoke multiple system calls between buffers in kernel and user spaces back and forth which is … Continue reading mmap – an effective way of reading/writing large files
已接收 — 2025年6月29日 山里来了攻城狮 | WILDLION

Build a speech transcription demo with OpenAI’s Whisper model in-browser using Transformers.js

2025年6月27日 11:53
Transformers.js Transformers.js is a Javascript implementation of the Python library transformers, which was developed by HuggingFace. Transformers.js uses ONNX Runtime to run pre-trained AI models with JavaScript. Long story short, ONNX Runtime allows developers to share neural network models interchangeably among frameworks and support a wide range hardwares. Common tasks supported by Transformers.js: Natural Language … Continue reading Build a speech transcription demo with OpenAI’s Whisper model in-browser using Transformers.js
已接收 — 2023年11月2日 山里来了攻城狮 | WILDLION

Deploy Grafana & Prometheus metrcs tracking system for your Go program

2019年9月10日 14:06
Step 1: integrate prometheus for let prometheus get metrics from go program, we need prometheus/client_golang to collect some informations import ( "github.com/prometheus/client_golang/prometheus/promhttp" "net/http" ) func main() { // ... http.Handle("/metrics", promhttp.Handler()) http.ListenAndServe(":9200", nil) } Step 2: Set up Prometheus Server configuration for Prometheus Server global: scrape_interval: 15s # Set the scrape interval to every 15 … Continue reading Deploy Grafana & Prometheus metrcs tracking system for your Go program

[转载] 幼园摇号记

2019年8月7日 16:30
教办幼儿园摇号未录取。公益性幼儿园摇号未录取。 成都市公益性幼儿园新生名单张榜公示,我们现居地附近公益幼园还有空余学位。补录是最后一丝希望。 妻子打电话催促我马上回家登记。 那会离下班还有三个小时。报名所需资料全在岳父家,来去路途辗转遥长。我还是先打电话咨询好了。幼园电话却一下午忙线。 下班后,我取回报名资料归家,翌日登记备用。 早上八点,昔日冷清的幼儿园门口早已人声鼎沸。家长弧形坐成五排,校门口几乎水泄不通。我问了几位家长。他们都是来给孩子补录登记的。有人通宵排队;有人登记过好几次;有人还在反反复复咨询相关事宜。大家像热锅上的蚂蚁,闷得透不过气。 妻子来电:“情况怎么样?” 我:“两百多人报名摇号。” 妻子:“我让你早点想办法!早点来登记。你就是不信。你说现在怎么办?” 我:“昨天没办法登记。资料没带过来。” 妻子:“你说现在怎么办?” 我:“我给儿子报私立幼儿园算了。” 妻子:“你不打算登记了?” 我:“摇号命中机率太小。” 妻子:“机率再小。你也得试一试!” 我:“不想试了。我去上班了。” 妻子:“你请一天假要死?” 我:“难得摇了。人真的太多了。” “你爱咋办就咋办!” 妻子匆忙挂掉电话。我在校园门口踟躇了片刻。黑压压的人群让我有些怯怕。我内心焦虑的不知如何表达。可惜儿子失去机会;摇号命中机率渺茫;我究竟应该怎么办?我不得不向现实妥协。 我转身去向地铁站。头脑一片空白。 突然妻子又来电了。 她西斯底里的哭泣。 大声咆哮: “我这辈子怎么遇到了你这种人!” “我不想和你过了!” “我要和你离婚!” “我讨厌你这不求上进的死皮样子!” “我听父母说了你多少坏话!” “我刚才差点出了车祸,你知道吗?” “你不是最能干吗?” “你不是网上无所不能吗?” “你不是到处托关系保证办好吗?” “我只要结果?” “这就是你给我的结果?” “儿子的一生都被你毁了!” 我没有反驳。低声安慰她:“别哭了。我回去登记。” 妻子的抽泣声萦绕耳边。哐当哐当的地铁声寂然。 原路折返。幼园老师告我,本区人数超限,不接受跨区户籍报名。我连忙联系熟人,提前去私立幼儿园登记。途经另一所公益性幼儿园。我上前仔细端详。竟然可以报名!我立即作好登记,等待下午六点摇号。随后,我又去了私园办理手续。以免万无一失。 太阳蒸熟了公路。燥热麻痹了我的皮肤。归家后,我打开所有房间的灯光,屋顶一片澄亮。儿子在成都读书,是一个复杂的问题;还是简单的问题?我们总共跑了四五个幼园。初衷未改。公益幼园若不合预期,私立幼园亦是现实选择。英雄折戟柴米油盐酱醋茶。我一个人在成都快活?我毁掉了儿子的整个人生?我到底是那种人?我可能真是一个没用的人。多向度的万箭穿心让人思绪失能;无能无力的残忍现实让人精神麻木。我倦缩在沙发上不想动弹。 晚些时候,妻子打来电话。她平复了许多。 妻子:“这次再摇不中。儿子就在老家读算了。” 我讨厌她的反复变幻。 “我已经为他报了私立幼园。摇不中。他就回成都读私立幼儿园。” 挂断电话。我径直去了学校。 “家长们都在操场摇号。你的证件呢?”幼园门口保安对我说。 我本以为学校通过微机摇号,直接张榜公示录取结果。保安大叔不管不顾我虑急万分的乞求。好在我突然意识到手机里存放了通行证。虽说“大闺女出嫁——头一遭”,确实也惊险万分。 摇号现场紧张异常。园长从纸箱里抽出号牌念读,一百多人只有二十名幸运儿。有人欢喜有人愁。中签家长的庆祝动作像极了绿茵场上的进球前锋,双拳紧握或单拳有力一提勾,紧咬的皓齿缝中随之憋挤出一个“耶”。 园长读报的号牌越来越多,中签机率越来越小。她每一次报数都像大家跌宕起伏情绪里的一波疯狂海浪袭来。此情此景,我感觉心房在被人渐进用力敲打。 园长读报了儿子的号码。我再三重复确认她没有读错。 心潮低涌的感触让我不自觉热泪盈眶。情绪像突然决堤的大坝急势而下。我想嚎啕大哭。内心又劝解自己:那多丢人。我立即转身拭泪,老泪纵横的模样轻笑了起来。 妻子来电询问结果。 我拒绝了接听。简讯复她:“中签。我想静静。” 出处: 幼园摇号记 … Continue reading [转载] 幼园摇号记

Set up your Secondary Network Interface for Ubuntu 18.04

2019年6月26日 11:11
if you are trying to attache the new network interface for your Ubuntu 18.04 EC2 instance, this post might help you to figure out. Summary because of Netplan is new network manager in Ubuntu 18.04, things became different as before, and Netplan looks not supported asymmetric routing for now, that is required you to set … Continue reading Set up your Secondary Network Interface for Ubuntu 18.04

Use Azure Devops Pipeline to build && deploy your project

2019年5月31日 00:09
this post will teach you how to deploy your own Docker registry and how to use Microsoft Azure Devops to automatically building your Github Go project, and deploy to your Docker Swarm Server How it works Pipeline download your github project Build your code by Dockerfile, make docker image then push to your own Docker … Continue reading Use Azure Devops Pipeline to build && deploy your project

Note of MongoDB

2019年3月14日 17:14
Concept Structure: Database -> Collection -> Documents Compare to Mysql: Collection VS. Table Document VS. Row Field VS. Column Collection is not strict about what goes in it Operations Databases // create database if it's not exists create it then switch current database use mydb // show current database db // list dbs , if … Continue reading Note of MongoDB
❌