C++ Primer 手记
1.数据类型
1.1 类型/字宽
- 1.bool
- 2.char 8bit
- wchar_t 16bit
- char16_t 16bit
- char32_t 32bit
- short 16bit
- int 16bit
- long 32bit
- long long 64bit
- float 6 位有效数字
- double 10 位有效数字
- long doubel 10 位有效数字
- 可寻址最小内存块为 “字节” 8bit = 1byte
- 存储的基本单元为“字” 1
[options]
# 主题颜色
colorscheme = "jellybeans"
colorscheme_bg = "dark"
enable_guicolors = true
# YouCompileMe
enable_ycm = true
# statusline
statusline_separator = "arrow"
statusline_iseparator = "bar"
enable_statusline_mode = true
buffer_index_type = 0
# tabline
enable_tabline_filetype_icon = true
# 版本控制
enable_vimfiler_gitstatus = true
# file tree
filemanager = "vimfiler"
filetree_direction = "left"
# google
enable_googlesuggest = true
# ------------------ui--------------------
Question 事情的经过大概是这样子 前几天 R 社站长问作品集应该怎么排序? 作为写过几天增删改查的我就叭叭了一堆,先这样这样,在那样那样,最后这样这样,就排好了 然后站长贴了一个排序算法,不同于冒泡选择排序算法,经过一阵思考和分析后,感觉妙啊 ~~~ 同时也觉得自己太过头发短见识短,孤陋寡闻了,沉浸在各种框架里殊不知解决核心问题的还是数学。 Answer b3 的 Markdown editor 数学公式支持 Katex \frac{(log_{10}Qviews4)+\frac{QanswersQscore}{5}+sum(Ascores)}{((Qage+1)-(\frac{Qage-Qupdated}{2}))^{1.5}} Qviews = question views,通常这个数会很大,几万至几十万 Qanswers = question answers,这个数相对于浏览量来说就非常小了,5-10 等等 Qscore = question score,评分,完全是搜索问题的人觉得这个回答值多少分就点一分,可为负 sum(Ascroes)不知道,不考虑 Q....
1.为什么要服务端渲染 因为公司后端服务在 k8s 上,是分布式的微服务,之前端全部打包部署在了物理机器(虚拟机)nginx 上,如果通过 helm 做应用商店的话,nginx 前端这部分无法处理,包括灰度部署,CI 等,全部都只能做到接口级别的处理,并不能连带静态资源文件一起处理,所以基于分布式的前端整改迫在眉睫。 偶然发现了 ngx-planet,整篇文章基于前几篇文章,可以看之前的几篇文章。 2.如何基于 ngx-palnet 进行服务端渲染 2.0 有路由前缀的情况下服务端渲染 ngx-planet 如何改进 在 start 函数中监听路由阶段,其中的 startWith 过滤路由要把 location.pathname 修改好,要将前缀去除掉,至于如何动态去除不写死,仁者见仁智者见智。 2.1 首先,准备打包好的静态文件 将 build 命令修改,注意 --deploy-url 的意思是,打包完成后,静态资源路径是什么 "build": "ng build --prod --deploy-url=/static/star-universe/ --base-href=/st....
客制化 由于公司和公司的业务不同,所以在 ngx-planet 的基础上,需要作出一些针对于业务的拓展 目前分出四个基础项目 @yunzai/stars:封装了 用户认证,元素权限,i18n 等系统初始化信息的内容,需要发包的,意为繁星. star-universe: portal 项目,所有子前端项目的入口,意为宇宙. star-dust:一些可能会通用的 components 都放到这个项目里,统一管理,意为星尘. star-uranus:模版项目,意为天王星. 开发环境 可以看到桌面共有四个编辑器,开发时需要跑起其中三个项目. star-universe,star-dust,star-uranus @yunzai/stars 因为是基础包,所以扩展了哪些功能点,先做一个介绍,因为发包,所以 planet 前缀都被我改名成为了 star 前缀,针对于 ngx-planet 加载过程请看前一篇 link start。 接下来看项目结构 首先基于 ngx-planet 加入了 auth,config,i18n,providers,stomp,token,user 这些文件夹 modu....
道标 准备好源码,然后跟着文章去看代码,在每个代码块的第一行,我都把 filename 写上了,并且打开了 gitalk。 项目结构 - packages/planet |--src |--application |--planet-application-loader.spec.ts |--planet-application-loader.ts # 应用加载器 |--planet-application-ref.spec.ts |--planet-application-ref.ts # 应用的引用 |--planet-application.service.spec.ts |--planet-application.service.ts # 应用逻辑处理 Service |--portal-application.spec.ts |--portal-application.ts # Portal 应用 |--component |--planet-component-loader.spec.ts |--planet-component-loader.ts # 组件加载器 |--pla....
微前端? 简单来说 从使用角度考虑 D 应用是由 ABC 三个应用/组件组合而成,通常在 Angular/Vue/React 单项目中很容易实现,但为了复用解耦,D 应用现由 3 个独立部署并带有通信机制的应用/组件组合而成。 从部署角度考虑 A,B,C,D 为并行四个打包后的静态文件,当有 E 应用使用 A,B,C,D 应用中的组件或者事件时通过类 eureka 服务发现注册的方式去复用组件或应用。 当然,这只是众多思路中的一种 当然,这只是众多思路中的一种 当然,这只是众多思路中的一种 好处: 应用自治: 只需要遵循统一的接口规范或者框架,以便于系统集成到一起,相互之间是不存在依赖关系的。 单一职责: 每个前端应用可以只关注于自己所需要完成的功能。 技术栈无关: 你可以使用 Angular 的同时,又可以使用 React 和 Vue。 这就好像使用 k8s 集群和 grpc 调用一样 架构模式 基座模式: 通常有一个 main/portal 应用来充当基座,提供基础服务,剩下的应用可插拔在基座上。好像 dashboard 和 widget 的关系 自组....
啊,我真是有点病
Vmalert vmalert executes a list of given alerting or recording rules against configured address some command line interface tool configure vmalert ./bin/vmalert -rule=alter.rules \ // PromSQL compatible datasource -datasource.url=http://localhost:8428 // Alert manager url -notifier.url=http://localhost:9093 // Alert manager replica rul -notifier.url=http://127.0.0.1:9093 // remote write compatible storage to persist rules -remoteRead.url=http://localhost:8428 // PromSQL compatible datasource ....
1.Alerting with Prometheus is separated in to two parts 1-1Alerting rules Alerting rules is a file that formatted by yml,it's define some exp in to the YAML file. Alerting rules is in Prometheus servers send alerts to an alert manager and alert manager managed those alerts. the rule document in there: the rules doc 1-2Alerting Manager AlertingManager is a command line tool and the command line tool flags has those functions configure immutable system parameters configuration file defines in....
1.Two types of rules Prometheus supports two types of rules .whitch may be configured and then evaluated at regular intervals: Recording rules and Alerting rules. 2.Recording rules 1.Recording rules allow you to precompute frequently needed or computationally expensive expressions and save their result as a new set of time series. 2.Be mutch faster than executing the origin expression every time it's need. 3.Rules within a group run sequentially at a regular interval. the syntax of a rule file f....
0.what 暴雪给策略性即时战略游戏放出了一些接口以用来让开发者研究沙盘推演 AI。老早以前的了。今天想着试一试接口,但是下载好游戏玩了一天,晚上才开始搭环境。哈哈哈哈哈 1.下载 SC2 2.下载地图 https://github.com/Blizzard/s2client-proto#downloads https://github.com/deepmind/pysc2 3.加入地图 放入 /Applications/StarCraft\ II/Maps 中 4.环境变量 export SC2PATH=/Applications/StarCraft\ II 5.python 环境 pip3 install pysc2 6.测试 python3 -m pysc2.bin.agent --map Simple64 7.查看 demo
Prometheus time series metrics collect toolkit 提供了 UI 服务,默认端口 30313 主要作用就是监控一下我们服务的各项指标,也有许多包已经集成了这个功能,基本上查找一下配置一下就可以快速的展示出各项指标了 业务指标 但例如 java_gc,go_gc,node_request_total 这种指标对我们来说没有特别大的用处,我们的着力点应该在于提取业务指标,各个业务系统数据源不同逻辑不同导致无法使用通用型第三方包来构建我们的指标。 这个时候就出现了 prometheus-exporter 用来放出自定义的业务指标,等待 prometheus 来此处收集。 prometheus exporter 其实很简单,就是攒一些 prometheus 数据格式的数据放入 /metrics 路由中等待 scrape 就好 下面使用 Go 来举例子 这里使用了 godror 驱动 Oracle,prometheus/client_golang 客户端,logrus 日志模块 一些命令行参数 main 函数主要就是构造 exporter 对象然....