自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

转载 Linux Centos 6.5网络启动不起来Bringing up interface eth0: Error:Connection activation failed:Device not man

1. Remove Network Manager from startup Services.#chkconfig NetworkManager off2. Add Default Net Manager#chkconfig network on3.Stop NetworkManager first#service NetworkManager stop4.and then star...

2019-04-01 22:26:08 479

原创 5:只出现一次的数字

def singleNumber(): """ :type nums: List[int] :rtype: int """ nums = [1,3,3,5,5] print(2*sum(set(nums))-sum(nums))if __name__ == '__main__': singleNumber()很好理解, 2*...

2019-03-24 15:09:20 157

原创 4:存在重复

# def containsDuplicate():# """# :type nums: List[int]# :rtype: bool# """# nums = [1,1,3,4]# return len(nums) > len(set(nums))# if __name__ == '__main__':# ...

2019-03-24 15:04:19 138

原创 9:两数之和(python)

def twoSum(nums, target): """ :type nums: List[int] :type target: int :rtype: List[int] """ # 创建一个空字典 键为需要值,值为下标 d = {} for x in range(len(nums)): a = target -...

2019-03-24 15:02:01 424

原创 3: 旋转数组(python)

class Solution(object): def rotate(self, nums, k): """ :type nums: List[int] :type k: int :rtype: None Do not return anything, modify nums in-place instead. ...

2019-03-24 14:06:05 158

原创 2:买卖股票的最佳时机 II(python)

def maxProfit(prices): """ :type prices: List[int] :rtype: int """ profit = 0 i = 0 while i < len(prices) - 1: if prices[i+1] > prices[i]: prof...

2019-03-24 13:27:35 280

原创 1:从排序数组中删除重复项(python)

nums=[1,2,3,3,3,5]j = 0 //定义以一个下标j 用它来存放数组不相同的元素for i in range(len(nums)): if nums[i] != nums[j]: //如果不相等 ,数组 j+1下标就把 那个不相等的数存起来,这样就是实现了 删除重复项 nums[j+1] = ...

2019-03-24 13:14:20 200

翻译 spark mlib NaiveBayes 笔记

import org.apache.log4j.{Level, Logger}import org.apache.spark.mllib.classification.{NaiveBayes, NaiveBayesModel}import org.apache.spark.mllib.linalg.Vectorsimport org.apache.spark.mllib.regressio...

2019-03-24 12:48:03 144

转载 pandas 参数详解:

读取CSV(逗号分割)文件到DataFramefilepath_or_buffer: str,pathlib。str, pathlib.Path, py._path.local.LocalPath or any object with a read() method (such as a file handle or StringIO)可以是URL,可用URL类型包括:http, ...

2019-03-17 14:12:57 3015

转载 Python中的TfidfVectorizer参数解析

input:string{'filename', 'file', 'content'}如果是'filename',序列作为参数传递给拟合器,预计为文件名列表,这需要读取原始内容进行分析如果是'file',序列项目必须有一个”read“的方法(类似文件的对象),被调用作为获取内存中的字节数否则,输入预计为序列串,或字节数据项都预计可直接进行分析。enco...

2019-03-17 10:37:10 1349

原创 模拟登入教务处

获取验证码 import requests import random from PIL import Image headers = { 'User-Agent...

2019-03-14 16:50:37 2459

原创 模拟登入github

获取验证码 import requests import random from PIL import Image headers = { 'User...

2019-03-14 16:49:53 262

原创 正则笔记

###学了会儿正则表达式,怕记不住,就记下来了 1:\d 字符串中的整数 2:\D 匹配所有的非数字字符 3:re.findall(‘a[cd]c’)匹配 acd adc ...

2019-03-14 16:47:52 69

原创 git 指令集合

# GitHub创建仓库提示代码 echo "# 项目名" &gt;&gt; README.md git init git add README.md git commit -m "first commit" git remote add origin git@github.com:qiubaiying/项目名.git git push -...

2019-03-14 16:44:12 105

原创 今日头条街拍图片爬取

import os import requests from urllib.parse import urlencode from hashlib import md5 from multiprocessing.pool import Pool GROUP_START = 1 GROUP_END = ...

2019-03-14 16:41:48 196

转载 Spring以及其优缺点。

什么是springSpring 是一个开源框架,是为了解决企业应用程序开发复杂性而创建的。 ... 在这篇由三部分组成的Spring系列的第1 部分中,我将介绍Spring框架。 我先从框架底层模型的角度描述该框架的功能,然后将讨论两个最有趣的模块:Spring面向方面编程(AOP)和控制反转(IOC)Spring 优点1.使用Spring的IOC容器,将对象之间的依赖关系交给Sp...

2019-03-14 15:46:21 248

转载 关于字符串输入问题

学C++的时候,这几个输入函数弄的有点迷糊;这里做个小结,为了自己复习,也希望对后来者能有所帮助,如果有差错的地方还请各位多多指教(本文所有程序均通过VC 6.0运行)1、cin 2、cin.get() 3、cin.getline() 4、getline() 5、gets() 6、getchar()附:cin.ignore();cin.get();//跳过一个字符,例如不想要的回车,空格等字符1、...

2018-05-18 14:16:54 225

原创 单链表删除所有值为key的删除操作

#include&lt;iostream&gt;#include&lt;cstdlib&gt;using  namespace std;  typedef struct node{  node *next;  int data;}*List;  void init(List *L){ *L=new node;  (*L)-&gt;next=NULL;}// void DeleteList...

2018-05-18 13:55:56 2863

原创 不用‘+’号求 a+b 小白创作 错误请指出 轻喷!!!

class Solution {public:    int aplusb(int a, int b) {    while(b != 0){              int  up= a &amp; b;            a = a ^ b;            b = (up &lt;&lt; 1);       }        return a;    }}; 之前没有看过位运,...

2018-05-18 09:03:36 199

原创 单链表的基本操作

#include&lt;iostream&gt;#include&lt;cstdio&gt;#include&lt;cstdlib&gt;  using namespace std; typedef struct node {  struct node *next;  int data; }*List;  void initList(List *L) {  *L=(node*)malloc(siz...

2018-05-17 22:51:11 108

空空如也

空空如也

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

TA关注的人

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