这两天突然碰到的一个问题,在开发和正式环境由于切换编译器导致了一些问题;下面的示例代码演示: #include <iostream> int test_evaluate_order(int a, int b, int c) { return a + b + c; } int fa() { std::cout << "1" << std::endl; return 1; } int fb() { std::cout << "2" << std::endl; return 2; } int fc() { std::cout << "3" << std::endl; return 3; } int main() { test_evaluate_order(fa(), fb(), fc()); return 0; } 上述代码在编译执行时: 在 clang v9.0.0 版本下,运行输出: 1 2 3 在 gcc v9.
Hello World
last update:注意: 以下过程是为 使用静态连接, 方便部署 规划的编译配置; 使用动态连接的情况很多流程可以简化(无需对 config.m4 进行修改); openssl 1.1.1b CC=gcc CXX=g++ ./Configure no-shared --prefix=/data/vendor/openssl-1.1.1 linux-x86_64 nghttp2 1.38.0 PKG_CONFIG_PATH=/data/vendor/openssl-1.1.1/lib/pkgconfig CC=gcc CXX=g++ CFLAGS=-fPIC CXXFLAGS=-fPIC ./configure --prefix=/data/vendor/nghttp2-1.38.0 --enable-shared=no --enable-lib-only # --with-boost=/data/vendor/boost-1.70.0 --enable-asio-lib curl 7.64.1 CC=gcc CXX=g++ CFLAGS=-fPIC CPPFLAGS=-fPIC ./configure --prefix=/data/vendor/curl-7.64.1 --with-nghttp2=/data/vendor/nghttp2-1.38.0 --with-ssl=/data/vendor/openssl-1.1.1 --with-pic=pic --enable-ipv6 --enable-shared=no --without-libidn2 --disable-ldap --without-libpsl --without-lber --enable-ares php 7.2.18 CC=gcc CXX=g++ ./configure --prefix=/data/vendor/php-7.2.18 --with-config-file-path=/data/vendor/php-7.2.18/etc --disable-simplexml --disable-xml --disable-xmlreader --disable-xmlwriter --with-readline --enable-mbstring --without-pear --with-zlib --build=x86_64-linux-gnu ldd > 扩展
BASIC apt update apt upgrade apt install aria2 build-essential cmake libpcre3-dev libssl-dev zlib1g-dev mkdir -p /data/server/v2ray BBR # 验证 lsmod | grep bbr # 挂载 modprobe tcp_bbr echo "tcp_bbr" >> /etc/modules-load.d/modules.conf # 启用 echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf # 生效 sysctl -p NGINX cd ~ wget http://nginx.org/download/nginx-1.15.12.tar.gz tar xf nginx-1.15.12.tar.gz cd nginx-1.15.12 ./configure --with-http_ssl_module --without-select_module --with-http_v2_module --with-http_gzip_static_module --prefix=/data/server/nginx make -j2 make install V2RAY cd ~ wget https://github.
尝试在 Linux 下工作了一段时间,安装了 N 多个种类发行版本,最终本着“不折腾”原则停留在了 Deepin,比较一下安装的几个版本感觉: * Ubuntu 安装过程很流畅,完成后简单换了下安装源,Gnome 尝试了几个开发工具写了些代码,大概持续了 4 天,实在搞不定 QQ / TIM (使用 Wine 能启动,要么无法输入,要么一堆框框,要么字体太丑);很几个工具出现输入法相关的问题,换 fcitx 后有缓解,但还有无法输出的应用。 Archlinux 从头安装一般人搞不了:安装过程查了各种“教程”,由衷的感觉自己对 Linux 底层了解还是太少,很多操作根本不知到干什么;当然,结果 OK 还是装上了,安装桌面环境尝试了 KDE 和 XFCE,最终觉得安装走的太糊涂,而且实在需要配置太多东西,遂放弃。 Antegros 基于 Archlinux 的发行版本,官网感觉比下面这个漂亮点,结果这个最搞笑;重启、重试安装了 N 多回,每次在所有配置完毕开始安装的时候提示“请稍候…”,然后就,没有然后了… Manjaro 对这个抱着希望最大,安装、初期使用都很不错,碰到的诡异问题在网上搜索到的结果都是1年前:网卡断开后无法重连;我需要配置 802.1 安全协议,做配置就要断开,断开就连不回来;后来以为网卡驱动问题,尝试良久未果,一度导致完全无法联网,放弃。 Deepin 本来选择 Arch 系列就是奔着移植的 Deepin 版本的 QQ/TIM 去的,所以想着干脆回到本家试试;尝试感受不错,各种东西都稳定,碰到一点点小问题,使用自带的驱动管理器安装闭源版本驱动失败(重启提示无法启动 Display 然后恢复开源驱动),但是关闭桌面,从纯命令行安装后一切正常;目前装了 Linux 版本 Steam 的 Dota2 来国服合同事来了两把没碰到问题。 在安装过程中经常碰到 Grub 无法正确引导的情况,大部分使用下面命令解决: # 确认启动 boot 分区位置 ls ls (hd1,gpt4) # 设置启动目标参数 set root=(hd1,gpt4) set prefix=(hd1,gpt4)/boot/grub # 启动 insmod normal normal 实际在进入 Linux 后需要重新安装或配置 GRUB 这里一般是:
https://github.com/terrywh/php-flame Flame 是一个基于协程的异步网络开发框架(PHP扩展)类似 Swoole 但相对更简单一些: <?php // 框架初始化 flame\init("http_server_demo"); // 第一个(主)协程 flame\go(function() { // 创建 HTTP 服务器(监听) $server = new flame\http\server(":::56101"); $server ->before(function($req, $res) { // 前置处理器(HOOK) $req->data["before"] = flame\time\now(); // 记录请求开始时间 }) ->get("/hello", function($req, $res) { // 路径处理器 // 简单响应方式 $res->status = 200; $res->body = "world"; }) ->post("/hello/world", function($req, $res) { // 路径处理器 // Transfer-Encoding: Chunked $res->write_header(200); $res->write("CHUNKED RESPONSE:") $res->write($res->body); $res->end(); }) ->after(function($req, $res, $r) { // 后置处理器(HOOK) flame\log\trace($req->method, $req->path // 请求时长日志记录 , "in", (flame\time\now() - $req->data["before"]), "ms"); if(!
由于需要在同一台机器部署两种 GO 环境(WSL + Win),这里对 go-plus 代码进行一点点修改,加入 goroot 配置参数来解决这个问题: // ~/.atom/packages/go-plus/lib/config/environment.js // ... // const getenvironment = (): {[string]: ?string} => { // ... if (!e.GOROOT) { let r = atom.config.get("go-plus.config.goroot") if (r && r.trim() !== '') { e.GOROOT = r } } // e.GINKGO_EDITOR_INTEGRATION = 'true' // return e // } 即通过配置参数 go-plus.config.goroot 模拟环境变量。
从网络上各处收集到的各种调整 Windows 配置相关的注册表项,记录以备不时之需~
在 第三章 中我们基本完成了雷区的绘制和布雷相关接口功能,我们留下了一个未完成的功能,“一次性打开连续的空格”。在开始编写主要游戏流程前,我们先把这里完成。
经过 [第一章][chapter-1] 和 [第二章][chapter-2] 我们已经将整个游戏的 “开头”(输入姓名、开始游戏)和 “结尾”(排行榜)做好了,今天我们来绘制雷区。
在绘制雷区时我们会使用上一章提到的 “动态绘制”,还会用到与第一章类似的一些样式来将我们的雷区绘制的更贴近于 Windows 的扫雷的效果。
Hints to the browser that might prime the pump for resources you will need.
Preload is the only exception here, being more of an instruction than just a hint. AddyOsmani @ https://plus.google.com/+AddyOsmani/posts/7JvGGPAAuCT