position

Elasticsearch 5.X系列不再支持geo_distance_range

匿名 (未验证) 提交于 2019-12-02 23:36:01
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u013476435/article/details/90675753 在使用es 5.3时,想使用geo_distance_range实现环形搜索。 geo_distance_range的介绍如下: 在使用时,想去将自己的数据导入到es中并添加上索引,这里我的位置字段是position。 JestResult jestResult = jestClient.execute(new CreateIndex.Builder("igomomemberinfo").build()); 然后再将index上添加indexMapping String mappingString = "{\"" + "igomomemberinfo" + "\":{\"properties\":{\"position\":{\"type\":\"geo_point\", \"index\":\"true\"}}}}"; PutMapping.Builder builder = new PutMapping.Builder("igomomemberinfo", "igomomemberinfo", mappingString); try { JestResult jestResult = jestClient

会飞的小鸟小游戏 原生js

左心房为你撑大大i 提交于 2019-12-02 23:35:40
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> * { margin: 0; padding: 0; } #fbWrap { width: 350px; height: 480px; background: url("img/bg.jpg"); background-size: 100% 100%; position: relative; overflow: hidden; margin: 0 auto; } #head { position: absolute; left: 50px; top: 150px; } #head span { background: url("img/bird0.png"); position: absolute; right: 0; top: 20px; width: 40px; height: 26px; background-size: 100% 100%; } #scoring { position: absolute; left: 50%; top: 40px; z-index: 2; font-size: 50px; } #menu { position:

RecyclerView的简单使用

匿名 (未验证) 提交于 2019-12-02 23:32:01
简单讲讲RecyclerView的使用:(这里用的是androidX,而不是之前的supprot-v7,用法基本一样) 1、引入recyclerView的依赖库: implementation 'androidx.recyclerview:recyclerview:1.0.0' 2、主布局内添加RecyclerView的布局控件 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <androidx.recyclerview.widget.RecyclerView android:id="@+id/recyclerView" android:layout_width="match_parent" android:layout_height="match_parent"/> <

getting absolute position of HTML element in webbrowser control with C#

依然范特西╮ 提交于 2019-12-02 23:12:46
I was wondering if its possible to get the absolute position of specific HTML element I have loaded in webbrowser control with C#. I tried almost all of the options that .Net provides.. none of them give me the correct position. all of them give me 0 for Y coordinate.. the element is definitely is not in 0.. does anybody have any solution or idea to solve this? here is the solution I got so far: // set the size of our web browser to be the same size as the image int width, height; width = webBrowser1.Document.Images[0].ClientRectangle.Width; height = webBrowser1.Document.Images[0]

链式表操作集

匿名 (未验证) 提交于 2019-12-02 22:56:40
本题要求实现链式表的操作集。 函数接口定义: Position Find( List L, ElementType X ); List Insert( List L, ElementType X, Position P ); List Delete( List L, Position P ); 其中 List 结构定义如下: typedef struct LNode *PtrToLNode; struct LNode { ElementType Data; PtrToLNode Next; }; typedef PtrToLNode Position; typedef PtrToLNode List; 各个操作函数的定义为: Position Find( List L, ElementType X ) :返回线性表中首次出现X的位置。若找不到则返回ERROR; List Insert( List L, ElementType X, Position P ) :将X插入在位置P指向的结点之前,返回链表的表头。如果参数P指向非法位置,则打印“Wrong Position for Insertion”,返回ERROR; List Delete( List L, Position P ) :将位置P的元素删除并返回链表的表头。若参数P指向非法位置,则打印“Wrong Position

python爬虫:爬取拉勾网数据

匿名 (未验证) 提交于 2019-12-02 22:54:36
import requests import json from bs4 import BeautifulSoup def crawl_detail(id): url = 'https://www.lagou.com/jobs/%s.html' % id headers = { 'Host' : 'www.lagou.com' , 'Referer' : 'https://www.lagou.com/jobs/list_Python?px=default&city=%E6%88%90%E9%83%BD' , 'Upgrade-Insecure-Requests' : '1' , 'User-Agent' : 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) ' 'AppleWebKit/537.36 (KHTML, like Gecko) ' 'Chrome/63.0.3239.132 Safari/537.36' } req = requests.get(url, headers =headers) # print(req.text) soup = BeautifulSoup(req.text, 'lxml' ) job_bt = soup.find( 'dd' , attrs ={ 'class' : 'job_bt' }) job_bt =

竟然可以用python炒股?

匿名 (未验证) 提交于 2019-12-02 22:51:30
由于笔者并无深厚的数学功底也无深厚的金融知识, 所以不会在本文中引用各种高深的投资模型或数学模型,参考书籍主要是《海龟交易法则》《以交易为生》。 交易系统 在交易之前,我们应该首先有一个交易系统用于指导我们自己交易,不一定有什么规范,但是可以作为一个交易的依据,至于这个依据可不可行,科不科学那就见仁见智了。 当然了,这里的交易系统不一定是程序,只是指你自己的交易原则或者遵守的一些技巧或者方法,你可以手动执行也可以借助编程语言,编程语言不就是一套用来使用的工具么. 这里参考海龟交易法则里面的交易体系( 这里只是参考大方向 ). 建立一个完善的交易体系,我们至少应该思考一下六个方面。 1、市场----买卖什么 2、头寸规模----买卖多少 3、入市----何时买入 4、止损----何时退出亏损的头寸 5、止盈----何时退出盈利的头寸 6、离市----何时离市 简单的示例 买卖A股 全仓 当日涨幅超过3%买入。 当持有头寸亏损超过3%,平仓 当日跌幅大于3%或者三个连续阴线 分析: 这个交易策略其实只有在行情以波浪形状向上的行情时候才能获利,如果是盘整的情况下,怕是会亏的很惨。这里之所以写的这么简单粗暴是为了后面策略测试撸代码简单。 数据获取及处理 因为这里说的是用python炒股,所以应该采用程序的方式去获取数据,如果人工炒股,下载任何股票行情软件都是可以的

python编写俄罗斯方块

匿名 (未验证) 提交于 2019-12-02 22:51:30
import pygame,sys,random,time block_initial_position,score,times,gameover,press,all_block,background=[20,5],[0],0,[],False,[[[0,0],[0,-1],[0,1],[0,2]],[[0,0],[0,1],[-1,1],[-1,0]],[[0,0],[0,-1],[-1,0],[-1,1]],[[0,0],[0,1],[-1,-1],[-1,0]],[[0,0],[0,1],[1,0],[0,-1]],[[0,0],[1,0],[-1,0],[1,-1]],[[0,0],[1,0],[-1,0],[1,1]]],[[0 for column in range(0,10)]for row in range(0,22)] background[0],select_block=[1 for column in range(0,10)],list(random.choice(all_block)) def move(n): if n==100: for row,column in select_block: pygame.draw.rect(screen,(255,165,0),((column+block_initial_position[1])*40,800-

Python -- seek定位文件指针位置 错误 io.UnsupportedOperation: can&#039;t do nonzero cur-relative seeks错误

匿名 (未验证) 提交于 2019-12-02 22:11:45
f=open("E:/test/悯农.txt",'r') str=f.read(17) print("读取的数据是:",str) position=f.tell() print("当前位置:",position) f.seek(4,0) #从头开始,偏移4个字节 position=f.tell() print("当前位置:",position) f.seek(4,1) #从当前位置开始,偏移4个字节 position=f.tell() print("当前位置:",position) f.seek(-4,2) position=f.tell() print("当前位置:",position) f.close() 总结: seek中whence参数的值: 0:open函数以r,w,带b的二进制模式,就是以 任何模式 打开文件,都能正常运行 1和2:open函数 只能以二进制模式 打开文件,才能正常运行,否则就会报出上面的错误 Python的官方文档的解释: 链接地址:https://docs.python.org/3/tutorial/inputoutput.html?highlight=seek >In text files (those opened without a b in the mode string), only seeks relative to the

用Python实现数据结构之树

匿名 (未验证) 提交于 2019-12-02 22:11:45
树 树是由根结点和若干颗子树构成的。树是由一个集合以及在该集合上定义的一种关系构成的。集合中的元素称为树的结点,所定义的关系称为父子关系。父子关系在树的结点之间建立了一个层次结构。在这种层次结构中有一个结点具有特殊的地位,这个结点称为该树的根结点,或称为树根。 相关概念 根节点:树中最顶部的元素 父节点:处了根节点都有父节点,每个节点最多只有一个父节点 孩子节点:一个父节点具有0个或多个孩子节点 兄弟节点:同一个父节点的孩子节点之间是兄弟关系 外部节点:一个没有孩子的节点称为外部节点,也叫叶子结点 内部节点:有一个或多个孩子节点的节点叫做内部节点 树的边:指一对节点(u,v),其中u是v的父节点或者v是u的父节点 树的路径:一系列连续的边组成了一条路径 节点的深度:节点的深度就是该节点的祖先的个数,不包括该节点本身,如果根节点的层数为1,则深度即为该节点的层数-1 节点的高度:如果p是树中的叶子节点,那么它的高度为0.否则p的高度是它的孩子节点中的最大高度+1 有序树:每个孩子之间有一定的顺序,例如: 一个树的抽象基类 class Tree(): """ 树的抽象基类 """ # 叫做位置的内嵌类,用于封装节点 class Position(): def element(self): raise NotImplementedError('must be implemented by