自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(26)
  • 收藏
  • 关注

原创 python 超时任务结束方式

from concurrent.futures import as_completed,ProcessPoolExecutorfrom concurrent.futures.thread import ThreadPoolExecutorimport randomimport threadingimport timeimport concurrentdef rand_sleep(i): # print(threading.currentThread().getName())

2022-03-17 10:13:52 776

原创 golang 实现并查集

package mainimport ( "fmt" "os")const SIZE =6//找到根节点func findRoot(x int,data []int)int { root :=x if data[root]==-1{ return root } else { root = findRoot(data[root],data) return root }}// 0 表示有环了func union(x int,y int,data []int,r

2021-07-21 19:29:48 249

原创 基于Yarn的Spark完全分布式搭建

限于机器个数限制,本次搭建3个节点的集群,其中包含1个master节点(Hdfs namenode and yarn resourceManger)和三个(包括Master)slave节点(hdfs datanode 和Yarn nodeManger)本次搭建,启动了keberos安全验证版本sottwareversionjdkjdk11hadoophadoop-3.2.2.tar.gzsparkspark-3.1.1-bin-hadoop3.2.tgz

2021-04-22 15:42:45 654 2

原创 SSM框架搭建

SSM泛指Spring+Spring MVC + Mybatis创建工程new一个project选择工程类型,点击next输入工程名字,点击next修改本地maven路径,点击Finish,这样工程的文件目录大致就搭建好了手动创建java和resources文件夹整合Spring和Mybatisspring和Mybatis 的版本对应关系本次采用的版本对应关系引入jar包,书写pom文件<?xml version="1.0" encoding="UTF-8"?&

2021-04-13 08:47:03 131

原创 TF-IDF单词逆文档频率

概述在文本挖掘中用于衡量一个单词在该文档中的重要性。声明单词ttt,.文档ddd,文档集合DDD,单词ttt在文档ddd中出现的频率为TF(t,d)TF(t,d)TF(t,d),DF(t,D)DF(t,D)DF(t,D)表示多少文档含有该单词。如果我们只用TFTFTF衡量单词的重要性,很容易过度重视在一个文档经常出现但是带有很少信息量的单词,例如停用词,语气词,礼貌用词等。TD-IDF提出了一种他的解决办法:IDF(t,D)=log⁡∣D∣+1DF(t,D)+1,IDF(t, D) = \log \fr

2021-04-04 13:57:42 206

原创 spark idea scala开发环境配置

书写pom文件<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.or.

2021-04-03 15:53:12 194

原创 2021-03-22

排序算法冒泡排序/** * 冒泡排序 * 稳定 * 内排序 * 最佳情况:数列有序,则时间复杂度为O(n),比较次数n,移动次数为0 * 最坏情况:数列逆序,则时间复杂度为O(n^2),比较次数n*(n-1)/2(等差数列求和),移动次数为n*(n-1)/2 * 平均情况:数列杂序,则时间复杂度为O(n^2) * 空间复杂度O(1) * */public class BubbleSort{ public static int[] bubbleSort(int[] array

2021-03-22 21:39:13 47

原创 linux解压缩笔记

tartar -zxvf filenamegzgunzip filename

2020-12-04 14:20:45 46

原创 scrapy框架的几个疑惑

scrapy框架图scrapy 框架如何启动的最常见的是通过命令行scrapy crawl

2020-12-03 09:19:23 112

原创 torchtext datasets总结

综述所有dataset继承自torchtext.data.Dataset,torchtext.data.Dataset继承自torch.utils.data.Dataset,他们都必须实现split和iters方法approach1 splits:# set up fieldsTEXT = data.Field(lower=True, include_lengths=True, batch_first=True)LABEL = data.Field(sequential=False)# mak

2020-12-02 09:18:18 2261

原创 good post

bert:https://towardsdatascience.com/bert-explained-state-of-the-art-language-model-for-nlp-f8b21a9b6270

2020-11-30 21:57:41 164

原创 算法常用推荐指标

累积增益(Cumulative Gain, CG)CGp=∑i=1prel[i]CG_{p} = \sum_{i=1}^{p} rel_[i]CGp​=i=1∑p​rel[​i]折损累计增益(Discounted cumulative gain,DCG)DCGp=∑i=1preliilog⁡2(i+1)=reli+∑i=2preliilog⁡2(i+1)DCG_{p}=\sum_{i=1}^{p} \frac{reli_{i}}{\log_{2}(i+1)}=rel_{i}+\sum_{i=2}

2020-11-22 19:54:49 126

原创 Contrastive Code Representation Learning

# 安装环境安装nodejs下载nodejsnpm root -g # 输出默认路径更改npm仓库路径npm config set prefix "D:\repository\node\node_global" #存储路径npm config set cache "D:\repository\node\node_cache" #缓存路径在contrastive_code代码执行npm install # 自动安装依赖pip install -e "." # 安装python依

2020-11-21 09:12:08 352 1

原创 pip国内源bak

阿里云 http://mirrors.aliyun.com/pypi/simple/豆瓣 http://pypi.douban.com/simple/清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/华中科技大学 http://pypi.hustunique.com/...

2020-11-19 10:47:59 66

原创 python深拷贝与浅拷贝

python赋值方式=浅拷贝深拷贝= 只复制该对象的引用,例如b=a,b只复制对象的引用,并不会在内存中创建新的对象。因此修改a的任何值,b也会跟随变化。浅拷贝 在内存中创建新的父对象,不创建子对象例如b = copy.copy(a), 会在内存中创建一个新的和a指向对象相同的对象,并且让b指向它,但是其中的子对象不会创建一份,仍然会指向原有子对象的引用。因此修改a的子对象,b也会发生改变,修改值对象,则不对发生改变。深拷贝 完全复制一份新的在内存中完全复制一份新的,因此和元对象毫无关

2020-11-08 11:16:33 94

原创 解决安装torchtext报错

ERROR: Command errored out with exit status 1: command: 'd:\env\python\python35\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\zhaoz\\AppData\\Local\\Temp\\pip-...

2020-03-29 12:00:11 1724

原创 centos安装mariadb

安装yum -y install mariadb-server mariadb启动systemctl start mariadb登陆初次登陆,无密码。直接Enter登陆mysql -u root -p修改密码 use mysql; UPDATE user SET password=password('root') WHERE user='root'; fl...

2020-03-14 11:15:51 96

原创 maven如何更换阿里源

maven如何更换阿里源官方文档:https://help.aliyun.com/document_detail/102512.html?spm=a2c40.aliyun_maven_repo.0.0.36183054bo12Rb

2020-03-04 10:01:00 1272

原创 scrapy middleware

scrapy middleware在setting.py加入USER_AGENT_LIST = ["Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; AcooBrowser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)", "Mozilla/4.0 (compati...

2019-10-24 14:27:42 151

原创 ununtu安装Mongodb社区版

导入mongodbGPG公钥wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -创建下载地址文件echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.2 multivers...

2019-08-15 17:24:54 113

原创 scrapy-redis报错:redis.exceptions.ResponseError: DISCARD without MULTI

scrapy日志报错19909:M 28 Jul 07:41:16.061 * 10000 changes in 60 seconds. Saving...19909:M 28 Jul 07:41:16.061 # Can't save in background: fork: Cannot allocate memory解决办法sysctl vm.overcommit_memory=...

2019-07-29 09:32:10 1637

原创 安装scrapy遇到的问题

目录安装scrapy报错原因安装scrapy报错pip install scrapy执行该命令报错Command "python setup.py egg_info" failed with error code 1 in C:\Users\keg\AppData\Local\Temp\pip-install-7oo8xsgf\Twisted\原因setuptools版本低,升级即...

2019-07-09 18:35:10 118

原创 Spring的依赖注入

在Spring中,依赖注入(Dependency Injection,简称DI)主要有两种变体,基于构造器的依赖注入和基于setter的依赖注入基于构造器的依赖注入基于构造函数的DI是由容器调用一个构造函数来完成的,该构造函数有许多参数,每个参数表示一个依赖项。调用具有特定参数的静态工厂方法来构造bean几乎是等价的。例如:public class SimpleMovieLister {...

2019-05-10 18:14:11 74

原创 使用Spring的IOC容器

首先编写AppBeanpublic class AppBean { private String helloString; public String getHelloString() { return helloString; } public void setHelloString(String helloString) { this.helloString = hell...

2019-05-10 17:10:37 90

原创 python便捷找出最大元素,最小元素

1)快捷的找出列表中最小值或者最大值import heapqnums=[1,2,3,4,5,7,11,-89,-9,0]print(heapq.nlargest(3,nums))print(heapq.nsmallest(3,nums))2)更为复杂结构可以采取下面的方式处理:import heapqlist=[ {'name':'zy','age':18}, {'name':'c

2018-01-18 22:49:23 1069

原创 python3处理文本

1)处理asciall编码格式整体处理:with open('something.txt','rt') as f : print(f.read())如果需要覆盖写入的话:with open('something.txt','wt') as f : f.write('fdf') 如果附加写入的话:with open('something.txt','at') as f : f.write(

2018-01-18 22:11:03 519

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除