elk笔记19--es python api

2023-11-12

elasticsearch-py 是es官方提供的低级客户端。其目标是为所有es相关的python 代码提供共同基础;因此,其尝试自由发布观点,切具备很好的扩展性。
es 官方也提供了一个高级的客户端库 elasticsearch-dsl ,其具有较多的限制范围,但是它是基于 elasticsearch-py 的一个更加 python 化的库。

本文基于 elasticsearch-py 介绍 es 常见的 python api,及其使用中的注意事项。

1 Elasticsearch

1.1 基础连接、写入、查询

#!/usr/bin/python
# -*- coding:utf-8 -*-
# refer https://elasticsearch-py.readthedocs.io/en/7.7.1/

from elasticsearch import Elasticsearch
import json
import datetime


def es_connect():
    # 单个节点,默认为9200
    # es = Elasticsearch(['10.120.75.103'])
    # es = Elasticsearch(['10.120.75.103:9200'])
    # es = Elasticsearch([{'host': '10.120.75.103', 'port': 9200}])
    # 多个节点
    # es = Elasticsearch(['10.120.75.103', '10.120.75.107'])
    # es = Elasticsearch(['10.120.75.103:9200', '10.120.75.107:9200'])
    # es = Elasticsearch([{'host': '10.120.75.103', 'port': 9200}, {'host': '10.120.75.107', 'port': 9200}])
    # 带认证节点, 增加 http_auth 选项, 等价于 curl -u elastic:elastic 10.120.75.102:9204
    es = Elasticsearch(['10.120.75.102:9204'], http_auth=('elastic', 'elastic'), timeout=30, max_retries=5)
    print('es_connect:')
    print(json.dumps(es.info()))


def es_index():
    es = Elasticsearch(['10.120.75.103:9201'])
    doc = {
        'author': 'kimchy',
        'text': 'Elasticsearch: cool. bonsai cool.',
        'timestamp': datetime.datetime.now(),
    }
    res = es.index(index="test-index", id=1, body=doc)
    print(res['result'])


def es_refresh():
    es = Elasticsearch(['10.120.75.103:9201'])
    res = es.indices.refresh(index="test-index")
    print(res)


def es_get():
    es = Elasticsearch(['10.120.75.103:9201'])
    # GET test-index/_doc/1
    res = es.get(index="test-index", id=1)
    print(res['_source'])


def es_search():
    es = Elasticsearch(['10.120.75.103:9201'])
    res = es.search(index="test-index", body={"query": {"match_all": {}}})
    print("Got %d Hits:" % res['hits']['total']['value'])
    for hit in res['hits']['hits']:
        print("%(timestamp)s %(author)s: %(text)s" % hit["_source"])


if __name__ == '__main__':
    es_connect()
    es_index()
    es_refresh()
    es_get()
    es_search()

纯命令式查询:
curl -XGET --header 'Content-Type: application/json' -u user:password 10.120.75.103:9201/platform_log/_count -d '{
        "query": {
            "bool": {
                "must": [
                  {"wildcard":{"hostname.keyword":{"value":"dds-tagging-sim-*"}}},
                  {"term":{"level.keyword":{"value":"ERROR"}}},
                  {"range":{"timestamp":{"gte":"now-30m","lte":"now"}}}
                ]
            }
        }
}'

1.2 通过 scroll api 拉取数据

es默认size最大值为10000,当数据过多的时候,直接search无法拉取所有数据,因此推荐使用scroll api来拉取数据;
以下为一个scroll api的案例,实际业务中只需要将过滤字段按需添加到 must、must_not、should、filter 中即可;

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import traceback
import requests
import time
from base64 import b64encode

USER = 'elastic'
PWD = 'elastic'
URL = 'http://127.0.0.1:9200'

data = []

ONE_DAY = 24 * 3600 * 1000 #ms

def get_now_ms():
    ts = int(time.time() * 1000)
    return ts
    

def get_base64_str(str_text):
    str_user_pwd = b64encode(str_text.encode('ascii'))
    return str_user_pwd.decode('ascii')
    
    
def data_scroll(index, scroll_id, scroll_size='1m'):
    payload = {
        'scroll': scroll_size,
        'scroll_id': scroll_id
    }
    try:
        r = requests.post(URL + '/_search/scroll',
                          data=json.dumps(payload),
                          headers={"Content-Type": "application/json",'Authorization': 'Basic ' + get_base64_str(USER+':'+PWD)}, timeout=10)
        data.extend(r.json()['hits']['hits'])
        if r.json()['_scroll_id'] and r.json()['hits']['hits']:
            return data_scroll(index, r.json()['_scroll_id'], scroll_size)
        return
    except:
        traceback.print_exc()
        return


def get_data(index_name, time_start, time_end):
    payload = {
        "size": 1000,
        "version": True, "sort": [{"@timestamp": {"order": "asc", "unmapped_type": "boolean"}}],
        "query": {
            "bool": {
                "must": [
                    {
                        "match_all": {}
                    },
                    {
                        "range": {
                            "@timestamp": {
                                "gte": time_start,
                                "lte": time_end,
                                "format": "epoch_millis"
                            }
                        }
                    }
                ],
                "filter": [],
                "should": [],
                "must_not": []
            }
        }
    }
    url = URL+'/{}/_search?scroll=1m'.format(index_name)
    r = requests.post(url=url, data=json.dumps(payload), headers={"Content-Type": "application/json",'Authorization': 'Basic ' + get_base64_str(USER+':'+PWD)}, timeout=10)
    data.extend(r.json()['hits']['hits'])
    data_scroll(index_name, r.json()['_scroll_id'], '1m')
    with open('data.json', 'w') as f:
        f.write(json.dumps(data))
    print(len(data))


if __name__ == '__main__':
    time_end = get_now_ms()
    time_start = time_end - ONE_DAY
    get_data('k8s_test-*', time_start, time_end)

2 Indices

2.1 indices 基础创建、删除

es.indices 对应es api中indices目录,包括如下api:
Create index
Delete index
Get index
Index exists
Close index
Open index
Shrink index
Split index
Clone index
Rollover index
Freeze index
Unfreeze index
Resolve index
此处以create,delete,get 为案例加以说明,其它类似:

#!/usr/bin/python
# -*- coding:utf-8 -*-

from elasticsearch import Elasticsearch
import json
import datetime


def es_create():
    es = Elasticsearch(['127.0.0.1:9200'], timeout=30, max_retries=5)
    ret = None
    if not es.indices.exists('test-index'):
        ret = es.indices.create('test-index')
    print(json.dumps(ret))


def es_get():
    # 此处get获取索引的整体信息
    es = Elasticsearch(['127.0.0.1:9200'], timeout=30, max_retries=5)
    ret = None
    ret = es.indices.get('test-index')
    print(json.dumps(ret))


def es_delete():
    es = Elasticsearch(['127.0.0.1:9200'], timeout=30, max_retries=5)
    ret = None
    if es.indices.exists('test-index'):
        ret = es.indices.delete('test-index')
    print(json.dumps(ret))


def es_index():
    es = Elasticsearch(['127.0.0.1:9200'])
    doc = {
        'author': 'kimchy',
        'text': 'Elasticsearch: cool. bonsai cool.',
        'timestamp': datetime.datetime.now(),
    }
    res = es.index(index="test-index", id=1, body=doc)
    print(res['result'])
    ret = es.count(index="test-index")
    print(json.dumps(ret))


if __name__ == '__main__':
    es_create()
    es_get()
    es_index()
    es_delete()

3 Ingest

es.ingest 中包含如下内容, 以下以put,get,delete为案例加以说明:
Put pipeline to add or update a pipeline
Get pipeline to return a specific pipeline
Delete pipeline to delete a pipeline
Simulate pipeline to simulate a call to a pipeline

#!/usr/bin/python
# -*- coding:utf-8 -*-

from elasticsearch import Elasticsearch
import json
import datetime


def ingest_put():
    es = Elasticsearch(['127.0.0.1:9200'])
    body = {
        "description": "describe pipeline",
        "processors": [
            {
                "set": {
                    "field": "foo",
                    "value": "bar"
                }
            }
        ]
    }
    ret = es.ingest.put_pipeline(id='pipe01', body=body)
    print(json.dumps(ret))


def ingest_get():
    es = Elasticsearch(['127.0.0.1:9200'])
    ret = es.ingest.get_pipeline(id='pipe01')
    print(json.dumps(ret))


def ingest_delete():
    es = Elasticsearch(['127.0.0.1:9200'])
    ret = es.ingest.delete_pipeline(id='pipe01')
    print(json.dumps(ret))


if __name__ == '__main__':
    ingest_put()
    ingest_get()
    ingest_delete()

4 Cluster

es.cluster 中包含 如下常见设置:
Cluster allocation explain
Cluster get settings
Cluster health
Cluster reroute
Cluster state
Cluster stats
Cluster update settings
pending_tasks
此处以 allocation_explain、health、cget_settings、put_settings 加以说明。

#!/usr/bin/python
# -*- coding:utf-8 -*-

from elasticsearch import Elasticsearch
from elasticsearch import RequestError
import json


def cluster_explain():
    es = Elasticsearch(['127.0.0.1:9200'])
    body = {}
    # 也可以指定 index,primary,shard 等3个参数;不指定默认返回第一个 unassigned 的shard
    try:
        ret = es.cluster.allocation_explain(body=body)
        print(json.dumps(ret))
    except RequestError as e:
        print(e)


def cluster_health():
    es = Elasticsearch(['127.0.0.1:9200'])
    ret = es.cluster.health()
    print(json.dumps(ret))


def cluster_get_settings():
    es = Elasticsearch(['127.0.0.1:9200'])
    ret = es.cluster.get_settings()
    print(json.dumps(ret))


def cluster_put_settings():
    es = Elasticsearch(['127.0.0.1:9200'])
    body = {"persistent": {"indices.recovery.max_bytes_per_sec": "50mb"}}
    # cluster settings 是部分更新的,put哪部分就更新哪部分
    ret = es.cluster.put_settings(body=body)
    print(json.dumps(ret))


if __name__ == '__main__':
    cluster_explain()
    cluster_health()
    cluster_get_settings()
    cluster_put_settings()

5 Nodes

es.nodes 中包含如下常见 api:
Nodes feature usage
Nodes hot threads
Nodes info
Nodes reload secure settings
Nodes stats
此处以为 hot_threads 和 info 加以说明:

#!/usr/bin/python
# -*- coding:utf-8 -*-

from elasticsearch import Elasticsearch
import json
import datetime


def node_hot_threads():
    es = Elasticsearch(['127.0.0.1:9200'])
    ret = es.nodes.hot_threads()
    # 也可以指定 node_id 查看具体某个node的线程信息
    print(json.dumps(ret))


def node_info():
    es = Elasticsearch(['127.0.0.1:9200'])
    ret = es.nodes.info(node_id=None)
    print(json.dumps(ret))


if __name__ == '__main__':
    node_hot_threads()
    node_info()

6 Cat

es.cat 中包含如下常见 api:
cat aliases
cat allocation
cat anomaly detectors
cat count
cat data frame analytics
cat datafeeds
cat fielddata
cat health
cat indices
cat master
cat nodeattrs
cat nodes
cat pending tasks
cat plugins
cat recovery
cat repositories
cat shards
cat segments
cat snapshots
cat task management
cat templates
cat thread pool
cat trained model
cat transforms
大部分使用方法类似,此处以 alias、allocation、health 加以说明:

#!/usr/bin/python
# -*- coding:utf-8 -*-

from elasticsearch import Elasticsearch
import json
import datetime


def cat_alias():
    es = Elasticsearch(['127.0.0.1:9200'])
    ret = es.cat.aliases()
    print(json.dumps(ret))


def cat_allocation():
    es = Elasticsearch(['127.0.0.1:9200'])
    ret = es.cat.allocation()
    # 查看节点磁盘、分片信息等
    print(json.dumps(ret))


def cat_health():
    es = Elasticsearch(['127.0.0.1:9200'])
    ret = es.cat.health()
    print(json.dumps(ret))


if __name__ == '__main__':
    cat_alias()
    cat_allocation()
    cat_health()

7 Snapshot

es.snapshot 中包含如下常见 api:
Put snapshot repository
Verify snapshot repository
Get snapshot repository
Delete snapshot repository
Clean up snapshot repository
Clone snapshot
Create snapshot
Get snapshot
Get snapshot status
Restore snapshot
Delete snapshot
此处以 snapshot 和 create加以说明,具体操作见笔者博文:elk笔记11–快照的使用

#!/usr/bin/python
# -*- coding:utf-8 -*-

from elasticsearch import Elasticsearch
import json
import datetime


def snapshot_cleanup():
    es = Elasticsearch(['127.0.0.1:9200'])
    ret = es.snapshot.cleanup_repository(repository='my_repository')
    print(json.dumps(ret))


def snapshot_create():
    es = Elasticsearch(['127.0.0.1:9200'])
    body = None
    # body 可以填写具体 indices 和 include_global_state 等各类参数
    ret = es.snapshot.create(repository='my_repository', snapshot='test_index_20201127', body=body)
    print(json.dumps(ret))


if __name__ == '__main__':
    snapshot_cleanup()
    snapshot_create()

8 Tasks

es.tasks 中包含如下cancel、get、list 等常见 api:

#!/usr/bin/python
# -*- coding:utf-8 -*-

from elasticsearch import Elasticsearch
import json
import datetime


def task_cancel():
    es = Elasticsearch(['127.0.0.1:9200'])
    ret = es.tasks.cancel(task_id='oTUltX4IQMOUUVeiohTt8A:12345')
    print(json.dumps(ret))


def task_get():
    es = Elasticsearch(['127.0.0.1:9200'])
    ret = es.tasks.get()
    print(json.dumps(ret))


def task_list():
    es = Elasticsearch(['127.0.0.1:9200'])
    ret = es.tasks.list()
    print(json.dumps(ret))


if __name__ == '__main__':
    task_get()
    task_list()
    task_cancel()

9 说明

  1. 参考文档
    elasticsearch-py 官文
    Python Elasticsearch api
  2. 补充说明
    上述 api 列表有部分直接从 官方文档 elasticsearch/reference 的api 列表中复制的,存在部分和python api 功能不完全对应的现象,但是基本不影响使用 es py api。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

elk笔记19--es python api 的相关文章

  • hbase 作为 Web 应用程序中的数据库

    关于在真实的 Web 应用程序中使用 hadoop 或相关技术的一个大问题 我只是想了解 Web 应用程序如何使用 hbase 作为其数据库 我的意思是 这是大数据应用程序所做的事情 还是他们使用普通数据库并仅使用这些技术进行分析 拥有一个
  • 从大文件中查找唯一值

    我有一个大文件 比如 10 TB 其中包含 MD5 哈希流 其中包含重复项 我的内存为 10MB 非常有限 硬盘空间不受限制 使用给定条件查找所有唯一的哈希值 消除重复项 请帮忙 这显然不是一个家庭作业问题 您可以使用外部排序算法 例如使用
  • Hadoop Nodemanager 和 Resourcemanager 未启动

    我正在尝试在 Ubuntu 13 10 64 位上设置最新的 Hadoop 2 2 单节点集群 操作系统是全新安装的 我尝试过使用 java 6 64 位和 java 7 64 位 按照以下步骤操作后this http raseshmori
  • Spark应用程序状态中的FAILED和ERROR有什么区别

    我正在尝试创建已提交的 Spark 应用程序的状态图 当应用程序被视为失败时 我有点迷失了 各州来自这里 https github com apache spark blob d6dc12ef0146ae409834c78737c11605
  • 大稀疏矩阵到三角矩阵 R

    我在 R 中有一个非常大的 大约 9100 万个非零条目 sparseMatrix 如下所示 gt myMatrix a b c a 1 2 b 1 c 2 我想将其转换为三角矩阵 上或下 但是当我尝试 myMatrix myMatrix
  • 如何在Hadoop中设置数据块大小?改变它有好处吗?

    如果我们可以更改 Hadoop 中的数据块大小 请告诉我如何操作 更改块大小是否有利 如果是 请告诉我为什么以及如何更改 如果没有 请告诉我为什么以及如何 您可以随时更改块大小 除非dfs blocksize参数在 hdfs site xm
  • HDFS 文件系统的 URL

    我在 HDFS 中有一些数据 user Cloudera Test 我可以通过运行很好地查看记录hdfs dfs cat Test 现在同一个文件 我需要在 scala 中将其读取为 RDD 我在 scala shell 中尝试了以下操作
  • 使用本地密钥 MONGODB 启用数据加密时出错

    我已成功加密 mongoDB 中的通信 但是当我尝试启用数据加密时出现错误 我使用的是 mongoDB 企业版 版本为 3 2 4 我在控制台中收到以下消息 ERROR child process failed exited with er
  • Python + Beam + Flink

    我一直在尝试让 Apache Beam 可移植性框架与 Python 和 Apache Flink 一起使用 但我似乎找不到一套完整的指令来让环境正常工作 是否有任何参考资料包含使简单的 python 管道正常工作的先决条件和步骤的完整列表
  • Google BigQuery 查询速度很慢

    我正在使用 Google BigQuery 并且正在从 PHP 执行一些简单的查询 例如 SELECT from emails WHERE email mail test com 我只是检查该电子邮件是否存在于表中 表 emails 目前为
  • 如何将非分区表转换为分区表

    如何使用 StandardSQL 或 LegacySQL 重命名 BigQuery 中的表 以便对之前未分区的表进行分区 我正在尝试使用 StandardSQL 但出现以下错误 重命名表dataset old table name TO d
  • 将 pandas 数据框中的行和上一行与数百万行进行比较的最快方法

    我正在寻找解决方案来加速我编写的函数 以循环遍历 pandas 数据帧并比较当前行和前一行之间的列值 例如 这是我的问题的简化版本 User Time Col1 newcol1 newcol2 newcol3 newcol4 0 1 6 c
  • 使用 Kinesis Analytics 构建实时会话

    是否有某个地方的示例 或者有人可以解释如何使用 Kinesis Analytics 构建实时会话 即会话化 这里提到这可能 https aws amazon com blogs aws amazon kinesis analytics pr
  • Postgresql - 在大数据库中使用数组的性能

    假设我们有一个包含 600 万条记录的表 有 16 个整数列和少量文本列 它是只读表 因此每个整数列都有一个索引 每条记录大约 50 60 字节 表名称为 项目 服务器为 12 GB RAM 1 5 TB SATA 4 核 所有 postg
  • 是否可以在表之间创建关系?

    Bigquery 看起来很棒 我有一个数据库类型 ETL 其中我的方案在实体之间有多种关系 我想知道是否有办法在它们之间建立关系 或者是否可以在数据集之间以某种方式模拟它们 请原谅我的英语 这不是我的语言 而且我不太了解它 您无法在 Big
  • Spark parquet 分区:大量文件

    我正在尝试利用 Spark 分区 我试图做类似的事情 data write partitionBy key parquet location 这里的问题是每个分区都会创建大量镶木地板文件 如果我尝试从根目录读取 则会导致读取速度变慢 为了避
  • 从多个大型 NetCDF 文件中提取数据的快速/高效方法

    我只需要从全局网格中提取特定节点集的数据 由纬度 经度坐标 按 5000 10000 的顺序 给出 这些数据是水力参数的时间序列 例如波高 全局数据集很大 因此分为许多 NetCDF 文件 每个 NetCDF 文件大小约为 5GB 包含整个
  • MATLAB 中的内存映射文件?

    我决定使用 memmapfile 因为我的数据 通常为 30Gb 到 60Gb 太大 无法放入计算机内存中 我的数据文件由两列数据组成 对应于两个传感器的输出 并且它们采用 bin 和 txt 格式 m memmapfile G E Str
  • CSS3变换:翻译最大值?

    我创建了一个实验无限滚动 Pi 的前十亿位 https daniellamb com experiments infinite pi 寻找 创建一个具有大量数据集的高性能滚动解决方案 我开始测试iScroll http iscrolljs
  • Flink:Jobmanager UI 中设置的并行度与任务槽有何关系?

    假设我有 8 个任务管理器和 16 个任务槽 如果我使用 Jobmanager UI 提交作业并将并行度设置为 8 我是否只使用 8 个任务槽 如果我有 8 个具有 8 个槽位的任务管理器 并以并行度 8 提交相同的作业 该怎么办 是完全一

随机推荐

  • C++ 中的常量,Const 关键字的用法(C++复习向p6)

    Const 常量 常量是固定的 程序执行期间不改变 又叫字面量 常量的类型 整数常量 0x23 浮点常量 1 23 布尔常量 true false 字符常量 n 字符串常量 nihao 定义常量 把字面量写成大写字母形式 是一个好习惯 方法
  • sql语句中分组取每组的最新数据

    今天敲sql的时候遇到了一个问题 业务流程是 检查记录 gt 整改通知 gt 整改回复 gt 检查组复查 如果复查不通过 则 检查组复查 gt 整改通知 gt 整改回复 gt 检查组复查 此时一条检查记录就可能对应多条整改通知去最新数据就用
  • JavaScript 将扁平的数组输出转为树形结构(需要考虑性能)

    扁平数组转为树形结构 做后台管理系统时也是经常用到的功能 面试时也是常常出现的 今天实现一下 引用两篇掘金大佬的文章 感谢大佬 一 什么是好算法 什么是坏算法 判断一个算法的好坏 一般从执行时间和占用空间来看 执行时间越短 占用的内存空间越
  • 刷脸设备引进越来越多的人喜欢靠脸消费

    刷脸支付已经成为今年比较热门的一个话题了 随便刷个新闻 微博或各大网络平台等都不免会看到有关刷脸支付的消息 感觉不了解刷脸支付就好像与这个时代脱离轨道了似的 那么今天就来给大家讲一讲刷脸支付对于消费者和商家各具有优势它比扫码支付更加安全便捷
  • gdb调试时显示数组

    可以用下面的方法来显示数组 p array len 其中p相当于print array就是数组首地址 也可以是数组名 len是想要显示的数组的长度 比如我有一个数组的定义 int a 1 2 3 4 5 那么想要显示的时候就可以写 p a
  • 基于百度PaddleHub实现人像美颜V1.0

    AI美颜核心技术之一就是人脸关键点检测 PaddleHub已经开源了人脸关键点检测模型 face landmark localization 人脸关键点检测是人脸识别和分析领域中的关键一步 它是诸如自动人脸识别 表情分析 三维人脸重建及三维
  • Spring入门-基本介绍和IOC控制反转(注解方式)

    1 Spring概述 Spring官网 Spring 顾名思义 java软件行业的春天 彻底解放了程序员从原生的开发中 一个轻量级的非侵入式的框架 特点 控制反转 IoC 面向切面 Aop 组成 组成 Spring 框架的每个模块 或组件
  • 工作学习中对 Windows 的积累

    wscript 命令 bat 文件 vbs 文件 wshell wshshell Sleep 1000 wshshell SendKeys 123 wshshell Sleep 1000 全局搜索 链接 https blog csdn ne
  • 跟奥巴马一起编程 C语言

    美国总统奥巴马不仅呼吁所有人都学习编程 甚至以身作则编写代码 成为美国历史上首位编写计算机代码的总统 2014 年底 为庆祝 计算机科学教育周 正式启动 奥巴马编写了很简单的计算机代码 在屏幕上画一个正方形 现在你也跟他一起画吧 输入格式
  • Activiti使用教程

    1 概念 首先需要分清三个概念 流程 流程实例 任务实例 Activiti提供4个bean来操作流程 RepositoryService RuntimeService TaskService HistoryService 2 流程 针对于某
  • 我们为什么使用KafKa

    为什么我们需要使用KafKa https blog csdn net SJF0115 article details 78480433
  • Atlas VPN 曝零日漏洞,允许查看用户真实 IP 地址

    Atlas VPN 已确认存在一个零日漏洞 该漏洞允许网站所有者查看 Linux 用户的真实 IP 地址 不久前 发现该漏洞的人在Reddit上公开发布了有关该零日漏洞的详细信息以及漏洞利用代码 关于 Atlas VPN 零日漏洞 Atla
  • stm32固件升级之U盘(四)

    目录 序言 什么是IAP升级 STM32代码启动介绍 IAP设计思路 bootloader设计 stm32内部flash分区 移植U盘底层源码 总结 序言 对于嵌入式软件开发来说 U盘离线更新固件是一种常用的更新手段 本篇文章讲述了如何通过
  • MyBatis核心配置文件详解

    siwuxie095 MyBatis 核心配置文件详解 1 核心配置文件的名称和位置没有固定要求 1 位置 建议在 src 下 2 名称 建议为 mybatis config xml 2 核心配置文件的内容全部写在根标签
  • delete 与 deleteLater()

    deleteLater 是QT的产物 而C 标准是没有的 delete是C 与QT公用的 所以很多人 是不太相信deleteLater 的 简单地讲一下deleteLater 的作用吧 很多人应该用过 QPointer 吧 deleteLa
  • 小议关于前端HTML的DTD(文档类型定义)

    小议关于前端HTML的DTD 文档类型定义 什么是文档类型定义 Document Type Defination DTD DTD 是用来定义XML文档结构的 HTML可以看做是XML的一种应用 其中DTD作为标准被保留了下来 规定了XML文
  • 放肆一点又何妨(一)-银川与腾格里沙漠

    此时家里的9420智障大音响放着许巍的 生活不止眼前的苟且 由于我不觉得眼前的生活很苟且 于是乎 切成了许巍的 蓝莲花 显然 一首符合心境的歌曲更能提高我的码字速度 言归正传 沙漠回来之后一直想写游记 记录下这一路上遇到的小伙伴 发生以及听
  • ArcGIS Flex热图

    ArcGIS Flex热图 一直都认为HeatMap是一个伟大的widget 它可以清晰的表达当前的热点区域 无论是直观上还是动态性方面 都是一项了不起的二维地图革新 之前在农业项目中多是等值面的应用 等值面它是通过精确插值计算所得到的结果
  • 【线性代数的几何意义】什么是线性代数

    一 什么是线性代数 线性与非线性 非线性问题则可以在一定基础上转化为线性问题求解 线性空间 对所谓的要满足 加法 和 数乘 等八条公理的元素的集合 线性函数 几何意义 过原点的直线 平面 超平面 代数意义 可加性 比例性 可加性 线性的可加
  • elk笔记19--es python api

    elk笔记19 es python api 1 Elasticsearch 1 1 基础连接 写入 查询 1 2 通过 scroll api 拉取数据 2 Indices 2 1 indices 基础创建 删除 3 Ingest 4 Clu