系统更换中,可能存在不可预料的 BUG

February 8, 2019

睁眼说瞎话 —— GUI

还记得很多年前,用着 WFC 拖界面,简单粗暴但是勉强能用,在 XP 下看看也还行,因为调用 .Net 的接口,体积也就 200kb。(但是真的丑 学到了 GDI+,一发 Read more

February 2, 2019

RUST 的定时与计时器

#![feature(duration_as_u128)] use std::sync::{Arc, Mutex}; use std::thread; use std::time::{Duration, SystemTime}; use std::sync::mpsc; use std::thread::JoinHandle; fn main() { let (tx, rx) = mpsc::channel(); let now = SystemTime::now(); let handle = thread::spawn(move || { { // 定时器 let tx = tx.clone(); thread::spawn(move || {// do something thread::sleep(Duration::from_millis(500)); tx.send(Err(())).unwrap(); }); } // 干一些不为人知的事情 thread::sleep(Duration::from_millis(300)); tx.send(Ok("result")).unwrap(); }); match rx.recv().unwrap() { // 计时器 Read more

January 31, 2019

前端打包常见工具

之前简单提到前端工程化的工具,Gulp 和 Webpack。 这里整几个例子来详细理解一下,hexschool/gulp-demo Gulp // production || development // # gulp Read more

January 28, 2019

一个短路操作符失效的 BUG?

遇上一个百思不得其解的 BUG logger.debug("%s%s", test_case_id, test_case_info) test_case_id = test_case_id or md5(test_case_info) logger.debug("MD5: %s%s", test_case_id, md5(test_case_info)) 09:18 None {'test_cases': [{'output': '420', 'input': '5 8'}]} 09:18 MD5: None b676c8555a8384fd346b062397524020 交代背景,这是通过 exec gunicorn –workers $n –threads $n –error-logfile /log/gunicorn.log –time 600 –bind 0.0.0.0:8080 server:app flask Web 服务调用的一个方法 class Read more

January 22, 2019

前端杂谈

作用域和闭包:你知道JavaScript的词法作用域是基于编译器(而非解释器!)语义的吗? 你能解释词法作用域和作为值的函数这两者的直接结果之 Read more

January 17, 2019

最简单的调用链和作用域

在《你所不知的 JavaScript》中,作者列举了 this 的几种绑定原则,最基本的就是默认绑定,在此就来细说一下这最简单的默认绑定。 global = typeof window !== 'undefined' ? Read more

© Gitai 2011

Powered by Hugo & Kiss.