• elasticsearch对可能破坏性的操作限制通配符

    PUT _cluster/settings?master_timeout=5m
    {
       "transient": {
             "action.destructive_requires_name": true
        }
    }
    
  • 数据类型对es bulk的影响

    共14912997 数据,就一个字段, 平均31bytes, 里面有平均7个token

    把字符串按mapping转成integer ; 1 shard

    merge后291.4m es cpu time 12m hangout user time 8m search 98ms

    string ; 1 shars

    merge后325.2m es cpu time 13m10s hangout user time 8m search 120ms

    string not analyzed; 1 shars

    merge后358.5m search 400ms

    string ; 8 shars

    es cpu time 12m19s hangout user time 4m

  • elasticsearch中限制搜索超时时间

    PUT _cluster/settings
    {
       "transient": {"search.default_search_timeout":"250s"}
    }
    
  • vim下调整splited窗口大小

    设置高度

    :resize 60

    设置宽度

    :vertical resize 1000

    调整高度

    :resize +10
    :resize -10

    快捷调整

    Ctrl-w +Ctrl-w - 可以快速调整窗口高度.
    Ctrl-w >Ctrl-w < 可以快速调整窗口宽度.
    10 Ctrl-w + 可以一次增加10行的高度.
    Ctrl-w = 可以按平均分配每个窗口的高度.
    Ctrl-w _ 把窗口调试设置成最大值(还要留一行给命令窗口).
    Ctrl-w | 把窗口宽度设置成最大值

    做个map映射

    一性次增加到1.5倍, 或者减少到原来0.67的高度

    nnoremap + :exe "resize " . (winheight(0) * 3/2) nnoremap - :exe "resize " . (winheight(0) * 2/3)

  • 今日单词

    mandatory

    /ˈmændətərɪ; US -tɔːrɪ; `mændəˌtɔrɪ/

    adj

    required by law; compulsory; 依法的;法定的;强制性的

    a mandatory payment

    Attendance is mandatory at all meetings.

  • 今日单词

    incarnation

    /ˌɪnkɑːˈneɪʃn; ˌɪnkɑr`neʃən/

    1. n [C] person that prominently displays a particular quality (突出表现某种品质的)典型人物,化身

      She is the very incarnation of goodness.

    2. n [C,U] (instance of) being alive in human form 化身

      the nine incarnations of Vishnu

      He believed he had been a prince in a previous incarnation.

  • Makefile 中四种变量赋值的不同

    http://stackoverflow.com/questions/448910/makefile-variable-assignment

    Lazy Set

    VARIABLE = value
    

    当变量被用到的时候, 会递归的展开

    Imeediate Set

    VARIABLE := value
    

    变量在申明的时候马上执行

    Set If Absent

    VARIABLE ?= value
    

    变量不存在的时候才赋值(也是lazy set)

    Append

    VARIABLE += value
    

    把value添加到已存在的变量后(如果变量不存在, 把value赋值给这个变量)

  • 今日单词

    obscurity

    This is an obscurity that catches the unwary.

    /əbˈskjʊərətɪ; əb`skjᴜrətɪ/

    1. n U

      state of being obscure 不明;费解;隐晦;无闻

      content to live in obscurity

    2. n C

      thing that is obscure or indistinct 晦涩或不明的事物

      a philosophical essay full of obscurity

  • 规则长什么样子

    https://www.gnu.org/software/make/manual/html_node/Rule-Introduction.html

    一个简单的makefile包含下面这样的一个或者多个规则

    target … : prerequisites …
        recipe
        …
        …
    

    A target is usually the name of a file that is generated by a program; examples of targets are executable or object files. A target can also be the name of an action to carry out, such as ‘clean’ (see Phony Targets).

    target(目标)通常是一个文件的名字并且是由接下来的recipe生成. 也可以是一个动作, 比如说clean. (参考Phony Targets)

    A prerequisite is a file that is used as input to create the target. A target often depends on several files.

    一个prerequisite(先决条件)就是目标的一个输入. 经常来说, 一个目标依赖多个先决条件. (译者注: 但实际上, 先决条件不仅仅可以是一个文件, 也可以是另外的target, 是链式依赖的)

    A recipe is an action that make carries out. A recipe may have more than one command, either on the same line or each on its own line. Please note: you need to put a tab character at the beginning of every recipe line! This is an obscurity that catches the unwary. If you prefer to prefix your recipes with a character other than tab, you can set the .RECIPEPREFIX variable to an alternate character (see Special Variables).

    Usually a recipe is in a rule with prerequisites and serves to create a target file if any of the prerequisites change. However, the rule that specifies a recipe for the target need not have prerequisites. For example, the rule containing the delete command associated with the target ‘clean’ does not have prerequisites.

    A rule, then, explains how and when to remake certain files which are the targets of the particular rule. make carries out the recipe on the prerequisites to create or update the target. A rule can also explain how and when to carry out an action. See Writing Rules.

    A makefile may contain other text besides rules, but a simple makefile need only contain rules. Rules may look somewhat more complicated than shown in this template, but all fit the pattern more or less.

  • Makefile 简介

    https://www.gnu.org/software/make/manual/html_node/Introduction.html

    make需要一个Makefile, Makefile告诉make如何编译和链接.

    这章会讨论一个简单的makefile, 描述了如何编译和链接一个文本编辑器程序,此程序由8个C文件和3个头文件组成.

    make重新编译程序的时候, 会保证每一个有新变化的C文件被重新编译, 如果头文件有变动, 每个包含这个头文件的C文件也需要重新编译. 每个编译会生成一个对象文件, 然后再把所有对象文件链接生成新的可执行程序.