进程 线程 子进程 About Processes,Threads,Coroutine
here is a story to explain what Processes,Threads,Coroutine is,andunderstanding of parallel and concurrent programming 1.Parallel and Concurrent Parallel: simultaneous execution of multiple tasks Concurrent Multiple tasks are executed alternately on the same processor 2.Processesmean program in progress strengths and weaknessesstrengths: more stability and safety weaknesses: require more resource overhead when processe swiching IPC is complex and time-consuming 3.ThreadsThread contained...
PHP ZIPARCHIVE 压缩文件处理目录结构 PHP ZIPARCHIVE directory structure
PHP ZIPARCHIVE 压缩文件处理目录结构 Prevent directory structure in compressed package $flag = $zip->open($filePath, \ZIPARCHIVE::CREATE);if ($flag!== TRUE) { //if Linux,need check file authorization exit("open file err="+$flag);}//add test.php to zip file $zip->addFile('test.php');// run rename$zip->renameName('test.php','test.php');
async await promise demo
async await promise 实例 video demo function step1(query) { return new Promise((success) => { let waiting=2000; setTimeout(() => { success('wait-time:'+waiting+' step:'+query); }, waiting); });}function step2(query) { return new Promise((success) => { let waiting=1000; setTimeout(() => { success('wait-time:'+waiting+'...
axios表单形式提交数据 axios post data by form type
axios post data by form type,axios application/x-www-form-urlencoded request({ // url: '', transformRequest: [function(data) { let ret = '' for (let it in data) { ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&' } return ret }], headers: { 'Content-Type':...
武汉肺炎冠状病毒疫情信息接口Api
中国武汉肺炎疫情信息统计接口Api 每天自动更新,含各国家和中国各城市历史统计 武汉加油 中国加油 众志成城 共渡难关!
git重置成新仓库 git reset to new repository
git重置成新仓库 git reset to new repository git checkout –orphan latest_branch git add -A git commit -am “commit message” git branch -D master git branch -m master git push -f origin master one line: git checkout –orphan latest_branch && git add -A && git commit -am “commit message” && git branch -D master && git branch -m master && git push -f origin master
wechat ban domain check
wechat ban domain check! $domain = 'https://baidu.com';$domain = urlencode($domain);$wxCheckUrl = 'https://weixin110.qq.com/cgi-bin/mmspamsupport-bin/newredirectconfirmcgi?main_type=2&evil_type=20&source=2&url=';$wxCheckUrl .= $domain;file_get_contents($wxCheckUrl);file_put_contents(uniqid().'.txt',json_encode($res));