position

笔记8 mongo基础命令

我的未来我决定 提交于 2020-01-12 13:40:24
一、基础命令 use test–选库 显示 switched to db test db.createCollection(‘goods’) 显示(‘ok’:1) show dbs 显示当前所有的库 use shop switched to db shop db.goods.insert({name:‘zhangsan’,age:9}) 显示writeResult({‘nInserted’:1}) show dbs–显示当前所有的库 2,查看数据库下面的集合 use shop switched to db shop show collections goods show tables goods 3,删除数据和删除集合 use test switched to db test db.dropDatabase() (“dropped”:“test”,“ok”:1) use shop switched to db shop db.goods.drop() true 二、CRUD命令 1、插入:insert 单条插入 db.stu.insert({name:‘lisi’,age:10,gender:1}) 显示 writeResult({“nInserted”:1})–成功 0则失败 _id字段自动创建,主键自动设置到这个字段 这个字段可手动指定,但不可重复 db.stu.find(

CSS3 3D转换效果

无人久伴 提交于 2020-01-12 11:40:40
CSS3 3D 转换 三维变换使用基于二维变换的相同属性,如果您熟悉二维变换,你们发现3D变形的功能和2D变换的功能相当类似。CSS3中的3D变换主要包括以下几种功能函数: 3D位移:CSS3中的3D位移主要包括translateZ()和translate3d()两个功能函数; 3D旋转:CSS3中的3D旋转主要包括rotateX()、rotateY()、rotateZ()和rotate3d()四个功能函数; 3D缩放:CSS3中的3D缩放主要包括scaleZ()和scale3d()两个功能函数; 3D矩阵:CSS3中3D变形中和2D变形一样也有一个3D矩阵功能函数matrix3d()。 1.3D位移 在CSS3中3D位移主要包括两种函数translateZ()和translate3d()。translate3d()函数使一个元素在三维空间移动。这种变形的特点是,使用三维向量的坐标定义元素在每个方向移动多少。 随着px的增加,直观效果上: X:从左向右移动 Y:从上向下移动 Z:以方框中心为原点,变大 从上图的效果可以看出,当z轴值越大时,元素也离观看者更近,从视觉上元素就变得更大;反之其值越小时,元素也离观看者更远,从视觉上元素就变得更小。 例子: height: 300px; float: left; margin: 15px; position: relative;

emacs org-mode文件转html文件

若如初见. 提交于 2020-01-12 06:49:18
Table of Contents 1. 发布站点 by emacs org-mode 1.1 org-mode 自带的导出方法 1.2 批量导出 1.3 css 美化 1.4 导出html 1. 发布站点 by emacs org-mode org-mode 写文档做笔记啥的很方便, 反应超快(因为是文本文件), 而且在emacs中可以显示出类似word的效果. 但是给没有emacs的人看时, 就不太方便.(没有高亮显示, 也无法在文本中跳转等等) 为了将继续使用 org-mode 带来的便利, 也为了方便别人查看自己的文档, 稍稍调查了一下org-mode导出html的功能. 1.1 org-mode 自带的导出方法 强大的org-mode其实自带了导出各种格式的功能. 导出html格式的快捷键很简单: C-c C-e h 虽然方便, 但是导出的html格式不太好看, 而且不能批量导出, 这个命令只能导出一个org文件. 1.2 批量导出 org-mode虽然也有导出org project的命令, 但是需要在 .emacs中配置相关导出选项. 每次导出不同的项目时, 需要修改 .emacs, 修改 .emacs后要么重新导入, 要么重启 emacs. 总觉得很麻烦. 后来参考了博客园上[麦满屯]的一篇博客 1 , 用Makefile来简化 org 文件的导出和发布.

模拟ThreeJS相机

廉价感情. 提交于 2020-01-11 22:57:00
WebGL 对于我来说操作太繁琐了; ThreeJS太方便了,但是相关的数学计算也封装起来了, 但是这一部分又很重要,所以通过ThreeJS 来学习底层相机的实现。 这是一篇学习笔记,学习的内容出自: 代码 , 教程 。更多的代码也来自ThreeJS库。 WebGL本不存在相机,想的多了也就有了。 模拟ThreeJS相机 1、着色器代码 glsl.fragmentShader.js export let fragmentShader = ` uniform vec3 color; void main() { // 给此片元的颜色值 gl_FragColor = vec4(color,1.0); } ` glsl.vertexShader.js export let vertexShader = ` uniform mat4 myProjectionMatrix; uniform mat4 myModelViewMatrix; void main() { // gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); gl_Position = myProjectionMatrix * myModelViewMatrix *vec4(position,1); } ` 2、自己模拟的相机 export

拉勾网爬虫Python代码实现

你。 提交于 2020-01-11 21:02:20
爬虫目的:爬取拉勾网上数据分析岗的数据,以便分析当前数据分析岗的需求现状。 爬虫实现的功能:根据城市名称、岗位名称关键字,即可爬取拉勾网上所需的数据信息。 爬虫的主要模块:   主函数与信息存储模块main.py   网页下载模块https.py   网页解析模块parse.py   IP代理池setting.py # main.py''' 拉钩网对于同一ip的大量请求行为肯定会进行封禁,所以需要准备代理池。 为了实现高自动化,需要对一系列可能出现的异常情况进行处理,断点处理,确保程序不挂。 为了提高效率,加入多线程。 数据持久化,在持久化之前需要先进行清洗。 ''' import https,parse,setting # import https.Http , parse.Parse , setting.headers ,setting.cookies import time import logging import codecs logging.basicConfig(level=logging.ERROR, format='%(asctime)s Process%(process)d:%(thread)d %(message)s', datefmt='%Y-%m-%d %H:%M:%S', filename='diary.log', filemode='a') def

Set position by percent - Android DisplayMetrics

*爱你&永不变心* 提交于 2020-01-11 12:39:09
问题 I like to use percents for all position in my apps . I always use same system. I am new at android programming. This is the class : public class SCREEN { DisplayMetrics dm = new DisplayMetrics(); Point size_ = new Point(); int width; int height; // DisplayMetrics metrics = Resources.getSystem().getDisplayMetrics(); SCREEN (Context CONTEXT_) { dm = CONTEXT_.getResources().getDisplayMetrics(); int densityDpi = dm.densityDpi; height = dm.heightPixels; width = dm.widthPixels; } // get full width

Get real position of objects in Javascript with Chrome

六眼飞鱼酱① 提交于 2020-01-11 11:51:45
问题 I've been coding a bit of Javascript to place a ducky randomly on this page. I wanted to make it hide on the side of objects (like the posts), but I ended up having to hardcode quite a bit of it, since I couldn't get a way to properly retrieve the real position of relative objects with Chrome. I read quite a few things about it, and used the recursive offsetParent way, but didn't get any good results. The last bit of code I tried was this: var getPost = function (obj) { var pos = {'x':0,'y':0

Obtain full size of colorbar in Matlab

回眸只為那壹抹淺笑 提交于 2020-01-11 07:19:09
问题 I am writing a plot automation routine for Matlab. However, I am having issues to assess the (horizontal) size of colorbars. I can use the following to get the size of the colorbar: cb = findall(groot,'Type','colorbar'); % get colorbar xwidth = cb.Position(3); This will give me the horizontal size of the colorbar, but EXCLUDES labels and tick labels. Do you have an idea how to obtain the full size of both the bar and the labels? Thanks in advance 回答1: In versions of MATLAB prior to R2014b, a

[orcle] oracle截取字符串的函数substr

核能气质少年 提交于 2020-01-11 06:55:49
substr    Oracle 中的截取字符串函数。   语法如下:   substr( string, start_position, [ length ] )   参数分析:   string   字符串值   start_position   截取字符串的初始位置, Number型,start_position为负数时,表示从字符串右边数起。   length   截取位数,Number型   其中,length为可选,如果length为空(即不填)则返回start_position后面的所有字符。   意思就是:   从start_position开始,取出length个字符并返回取出的字符串。   具体参考示例。   示例:   SELECT substr('This is a test', 6, 2) FROM dual 返回 'is'   substr('SyranMo have a dream', -8, 2) 来源: https://www.cnblogs.com/kentyouyou/archive/2013/03/06/2945495.html

Programmatically set console window size and position

落爺英雄遲暮 提交于 2020-01-11 06:09:12
问题 I would like to open multiple console programs on my desktop. This is what I have to do everytime: 1.Right click Desktop->Screen resolution->Detect (4 monitors). 2.Open 16 different console programs (4 per screen). 3.Clicking on all windows to get the Z-order correctly. 3.Right click Taskbar->Show Windows Stacked (to organize all 16 windows to perfect squares, 4 on each screen in order of z-index). Is there a way to do even just a part of this programmatically to help this go quicker? 回答1: