批量更新某个字段 例1: db.getCollection('bond_sentiment_news').find({"source" : 2,"siteUrl" : "http://www.21jingji.com/"}).forEach( function(item){ db.getCollec ...
分类:
数据库 时间:
2021-03-31 12:11:19
阅读次数:
0
js代码: 1 function wordlimit(cname, wordlength) { 2 var cname = document.getElementsByClassName(cname); 3 for (var i = 0; i < cname.length; i++) { 4 var ...
分类:
Web程序 时间:
2021-03-31 12:07:07
阅读次数:
0
在win10上开发好的python项目要部署在Linux上要面对的问题:怎么在Linux上跑py文件呢? 以Lunix CentOS7.x平台为例,CentOS系统上自带的已有python2.x 的版本,使用命令可以查看。 但我们需要python3.x 的主流版本,此时建议不要删除原有的python ...
分类:
编程语言 时间:
2021-03-31 11:47:11
阅读次数:
0
在python的字典对象中,可以直接使用键名获取键值,像这样: >>> d = {"x":1,"y":2} >>> d["x"] 1 >>> d["y"] 2 >>> 但如果键名不存在,则会报错: >>> d["z"] Traceback (most recent call last): File ...
分类:
编程语言 时间:
2021-03-30 13:57:43
阅读次数:
0
1:列表的去重操作 al = [1, 1, 2, 3, 1, 2, 4] #set方法元素去重 al_set = set(al) print(list(al_set)) #集合不支持索引操作,可以先将之转换为列表 #formkeys方法 al2 = {}.fromkeys(al).keys() pr ...
分类:
编程语言 时间:
2021-03-30 13:56:21
阅读次数:
0
#include <iostream> #include <vector> #include <thread> #include <mutex> #include <condition_variable> #include <queue> #include <functional> using na ...
分类:
编程语言 时间:
2021-03-30 13:55:19
阅读次数:
0
一.创建列表 1.创建一个普通列表 >>> tabulation1 = ['大圣','天蓬','卷帘'] >>> tabulation1 ['大圣', '天蓬', '卷帘'] >>> tabulation2 = [72,36,18] >>> tabulation2 [72, 36, 18] 2.创建 ...
分类:
编程语言 时间:
2021-03-30 13:55:04
阅读次数:
0
1. 执行命令:netstat -tunlp 2. 执行 :kill -9 6153 (为占用进程的PID) 或者 意思是地址已被使用,搜索相关问题后发现是因为,你曾启动过相同或者类似的服务占用了这个端口(一般来讲,在Mac上直接用Python启动的话,会导致退出不完整,你不能通过点击GUI的“退出 ...
分类:
其他好文 时间:
2021-03-30 13:52:55
阅读次数:
0
Shell函数 linux shell 可以用户定义函数,然后在shell脚本中可以随便调用。 shell中函数的定义格式如下: [ function ] funname [()] { action; [return int;] } 说明: 1、可以带function fun() 定义,也可以直接f ...
分类:
系统相关 时间:
2021-03-30 13:46:15
阅读次数:
0
1 import os 2 3 # 获取手机系统信息 4 phone_sys = os.popen('adb shell "cat /system/build.prop | grep "product""').read() 5 print(phone_sys) 6 7 # 获取手机设备型号 8 de ...
分类:
编程语言 时间:
2021-03-30 13:42:38
阅读次数:
0