07 2018 档案
摘要:import jiebaimport pandas as pdtxt = open("hlm.txt", "r", encoding="gb18030").read()from gensim.models.word2vec import Word2Vec s...
阅读全文
摘要:from gensim.test.utils import common_texts, get_tmpfilefrom gensim.models import Word2Vecpath = get_tmpfile("word2vec.model")mode...
阅读全文
摘要:/* 包含的头文件 */ #include #include /* 定义一个表示链表的结构体指针 */ struct list { int id; /* 标识这个元素方便查找 */ ...
阅读全文
摘要:#includetypedef struct Student //声明结构体类型 struct Student { int num; float score; struct St...
阅读全文
摘要:#includeint main() { int *p1,*p2,*p,a,b; printf("please enter two integer numbers"); scanf("%d,%d",&a,&b); p1=&a; ...
阅读全文
摘要:redis 安装完成后,以下代码可以直接运行#!/usr/bin/env python3# -*- coding: utf-8 -*-"""Created on Wed Sep 5 16:08:51 2018@author: luogan"""impor...
阅读全文
摘要:#!/usr/bin/env python3# -*- coding: utf-8 -*-"""Created on Fri Jul 27 18:08:26 2018@author: luogan"""# 树节点类构建class TreeNode(objec...
阅读全文
摘要:index 这是很简单的一个插入数据的方法,每条数据调用一个index方法,代码如下from datetime import datetimefrom elasticsearch import Elasticsearches = Elasticsearch...
阅读全文
摘要:haskelllet fibonacci n = if n fibonacci 206765pythondef factorial(n): if n==1 or n==2: return 1 else: return...
阅读全文
摘要:public class Employee{ String name; int age; String designation; double salary; // Employee 类的构造器 public Employee(Str...
阅读全文
摘要:public class BubbleSort{ public static void main(String[] args){ int a[] = {1, 23, 45, 6, 0, 99, 100, 89, 34, 56}; ...
阅读全文
摘要:#include#include#include int main(){ double a,b,c,disc,x1,x2,p,q; scanf("%lf%lf%lf",&a,&b,&c); disc=b*b-4*a*c; if (disc<0) ...
阅读全文
摘要:原文链接sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin sudo rm -fr /Library/PreferencesPanes/JavaControlPanel.prefpa...
阅读全文
摘要:package mainimport "fmt"func fibonacci( num int ) int{ if num<2{ return 1 } return fib...
阅读全文
摘要:from elasticsearch import Elasticsearch# 默认host为localhost,port为9200.但也可以指定host与portes = Elasticsearch()# 添加或更新数据,index,doc_type名称...
阅读全文
摘要:open ~/.ssh在.ssh/config(或者/etc/ssh/ssh_config)中配置:StrictHostKeyChecking noUserKnownHostsFile /dev/null
阅读全文
摘要:left = pd.DataFrame({'A': ['A0', 'A1', 'A2'], 'B': ['B0', 'B1', 'B2']}, index=['K0', 'K...
阅读全文
摘要:#\d 匹配一个数字字符。等价于 [0-9]#\D 匹配一个非数字字符。等价于 [^0-9]#过滤字符串中的英文与符号,保留汉字import rest = "hello,world!!%[545]你好234世界。。。"ste = re.sub("[A-Za-...
阅读全文
摘要:官方document#1.0import rem=re.search('(?<=abc)def','cxabcdefgb')print(m.group(0))#1.1m=re.search(r'(?<=-)\w+','apam-egg')print(m.gr...
阅读全文
摘要:import cv2# Load an color image in grayscaleimg = cv2.imread('psu.jpeg',3)#cv2.imshow('image',img)res=cv2.resize(img,(1340,1104),...
阅读全文