- 博客(18)
- 收藏
- 关注
转载 单例模式 数据库连接池 内部类 javabean 工厂类
class Singulation{private static Singulation instance =null;private Singulation(){}public static Singulation getinstance{if(instance==null){Synochronized(Singulation.class){if(instance=...
2018-11-18 23:59:05 301
转载 map set vector
接口 collection 常用方法 add() contains() clear() isEmpty() remove() size()Set<Integer> test = new TreeSet<>();TreeSet:会将里面的元素默认排序。List接口一共有三个实现类,分别是ArrayList、Vector和LinkedListIterator<...
2018-11-13 16:26:53 143
转载 数组, arraylist
dataType[] arrayRefVar = new dataType[arraySize];dataType[] arrayRefVar = {value0, value1, ..., valuek};public static int[] reverse(int[] list) {String str[][] = new String[3][4];ArrayList 底...
2018-11-13 16:26:39 156
转载 stringbuffer
public StringBuffer append(String s)public StringBuffer reverse()public delete(int start, int end)public insert(int offset, int i)replace(int start, int end, String str)replace(int start, in...
2018-11-13 16:26:24 120
转载 string
在eclipse中按快捷键 alt + shift + s 选择generate constructor using fields。然后在弹出框中选择成员变量 即可快速创建构造方法String.Trim()方法会去除字符串两端,不仅仅是空格字符,它总共能去除25种字符: ('/t', '/n', '/v', '/f', '/r', ' ', '/x0085', '/x00a0', ' '...
2018-11-13 16:26:07 119
转载 IO
File类代表与平台无关的文件和目录,他可以操作文件或目录,比如 File能新建、删除、重命名文件和目录,File类不能访问文件本身。如果要访问文件本身,则使用输入/输出流。File file = new File("c:\\a.txt");System.out.println(file.exists());// File对象是否是目录System.out.println(file...
2018-11-13 16:25:51 92
转载 reader_buffer
在Eclipse里面,输入Syso然后按 ALT+/不起作用。正确的用法如下,先输入一行 System.out.println(); 然后连按5次以上shift键,其实就是粘滞的功能。接着再输入Syso,按ALT+/ 就会自动补全了。java string 类 ...
2018-11-13 16:25:33 124
原创 去标点问题
sd1=re.sub("[\s+\.\!\/_,$%^*(+\"\']+|[+——!,。?、~@#¥%……&*()]", "",sd)import refrom zhon.hanzi import punctuationfrom zhon.hanzi import non_stopsfrom zhon.hanzi import stopscorpus='花!呗/期?免,...
2018-11-13 16:25:08 687
转载 lucene_IKanalyzer
File file = new File("f://youyajie"); FSDirectory directory = FSDirectory.open(file); //用来创建索引 IndexWriterConfig conf = new IndexWriterConfig(Version.LUCENE_36, ...
2018-11-09 14:02:17 163
转载 Cpython
先编译在运行from distutils.core import setup, Extensionfrom Cython.Build import cythonizeimport numpysetup(ext_modules = cythonize(Extension( 'dot_cython', sources=['dot_cython.pyx'], langu...
2018-11-09 14:01:32 1139
转载 python项目管理
from gconvRNN.config import get_config(gconvRNN文件名,config.py get_config函数)argparse是python标准库里面用来处理命令行参数的库1)import argparse 首先导入模块2)parser = argparse.ArgumentParser() 创建一个解析对象3)parse...
2018-11-09 14:00:46 1220
转载 scrapy 爬虫
import requestss=requests.get("http://www.sina.cn")print(s.text)content返回的是str 类型,就是我们眼睛所看到的内容,被浏览器渲染过。bytes类型text返回的是unicode 类型,可能是返回的最原始的数据,可以理解为尚未渲染过。s.encoding = 'UTF-8'str转bytesbyte...
2018-11-09 14:00:06 119
原创 css html javascript
css 进行修饰 大小 字体高度 背景. class idhtml几种类型 表单 表格 列表 外加标签 属性javacript函数定义 页面本身跳转jQuery简化function document作用范围...
2018-11-09 13:58:54 96
转载 LDA模型
process4appyModelfileslineslogp(w|α,β)=L(γ,ϕ;α,β)+D(q(θ,z|γ,ϕ)||p(θ,z|w,α,β)) (γ∗,ϕ∗)=argminγ,ϕD(q(θ,z|γ,ϕ)||p(θ,z|w,α,β)) 、https://blog.csdn.net/u011414416/article/detai...
2018-11-09 13:58:24 99
原创 word2vec
from gensim.models import word2vec 结果好坏跟训练词库有关。#[['I', 'am', 'hansome'], ['Mu', 'wen', 'looks', 'cool'], ...]# 用生成器的方式读取文件里的句子# 适合读取大容量文件,而不用加载到内存class MySentences(object): def __in...
2018-11-09 13:57:55 324
原创 elasticsearch
configuration file: {install-path}\config\elasticsearch.ymlcluster.name——修改集群名称,以后安装其他elasticsearch节点时,只要名字相同,es就认为是自家人,组成一个集群node.name——当前节点的名字path.data——存放数据的路径path.logs——日志文件的路径network.host——...
2018-11-09 13:57:04 89
原创 结巴的几种使用
分词 jieba.cut 三种模式分词的位置 jieba.tokenize分词的添加 jieba.add_wordt提取关键词import jieba.analysejieba.analyse.extract_tags自定义词典 jieba.load_userdict()去除停用词stopwords={}.fromkeys(['的‘,’了”] Ag ...
2018-11-09 13:54:22 190
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人