WengQiang's Blog

where there is a will, there is a way!

type

unit type

(), whose only possible value is an empty tuple: ()

empty type

!, cannot be instantiated, it is different from the () type, which has exactly one possible value
The main advantage of this type is that it can be cast to any other type

1
2
3
fn foo() -> ! {
panic!("This call never returns.");
}

custom type

  • struct
  1. unit struct a generic type struct
    1
    struct UnitStruct;
    阅读全文 »

最近远程访问家里的电脑,因为家里的电脑会关机或者设置了休眠,远程访问就失败,折腾了一会,发现可以通过wake on lan功能远程开机/唤醒, 以下操作设置是在你已经可以正常远程访问你远程主机的前提下:

打开wake on lan设置

  1. bios 设置(需要bios支持该功能) bios wakeonlan

  2. network adaptor(网卡适配器设置)

技术指标

  1. MA(moving average) 计算方式:某一段时间的收盘价之和/该段时间
    \[MA = \frac{P_1 + P_2 + ... + P_n}{n}\]

  2. WMA(weighted moving average) \[WMA = \frac{1*P_1 + 2*P_2 + ... +(n-1)*P_{n-1}+ n*P_n}{\frac {n*(n+1)}{2}}\]

  3. EMA(exponential moveing average)

  4. RSI(relative strength index) \[RSI = 100 - (\frac{100}{1+RS})\] \[RS = \frac{average\quad of\quad x\quad day's\quad up\quad closes}{average \quad of\quad x\quad day's\quad down\quad closes}\]

缠中说禅

  1. 均线系统
  • 多头模式 vs 空头模式 > 以7日均线以及14日均线为例: 7日均线长期在14日之上为多头, 反之为空头

  • 弱收敛、强收敛、交叉缠绕 > 弱收敛:走势突破短期均线却不能突破长期均线
    > 强收敛:走势突破长期均线然后形成陷阱
    > 交叉:走势突破长期均线,然后反复
    阅读全文 »

centos 7(64) 系统

  1. 防火墙
  • 查看防火墙是否开启 firewall-cmd --state

  • 重载防火墙,使新规则生效 firewall-cmd --complete-reload

  • 查看打开的端口 firewall-cmd --list-ports

    阅读全文 »

basic concepts

  • crate: rust package
  • cargo: rust's build system and package manager
  • prelude: pre-import module
    1. at the root of every crate, the compiler injects an implicit extern crate std;
    2. in every module, the compiler injects an implicit use std::prelude::v1::*; (for now)
阅读全文 »
0%