自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

K.Sun

用最简单的文字解释问题,用最少的步骤解决问题!

  • 博客(17)
  • 资源 (8)
  • 收藏
  • 关注

原创 Spring Boot打包可执行的jar或者war文件

首先pom文件中包含有spring-boot-maven-plugin:<?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:schemaLocatio

2017-03-29 13:57:21 8711

原创 Word Pattern

题目地址:https://leetcode.com/problems/word-pattern/#/descriptionGiven a pattern and a string str, find if str follows the same pattern.Here follow means a full match, such that there is a bijection betwee

2017-03-23 16:50:30 290

原创 K-diff Pairs in an Array

题目地址:https://leetcode.com/problems/k-diff-pairs-in-an-array/#/descriptionGiven an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here a k-diff pair

2017-03-23 15:51:59 436

原创 Encode and Decode TinyURL

题目地址:TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-tinyurl and it returns a short URL such as http://tinyurl.com/4e9iAk.Design the encode and de

2017-03-23 13:36:49 368

原创 sed对文件的读操作

原始数据:$ cat dataline 1line 2line 3line 4line 5line 6line 7line 8line 9line 10$ cat tdata This is a joke.将tdata中的数据插入到data中指定的行后:$ sed '4r tdata' dataline 1line 2line 3line 4This is a jo

2017-03-22 11:59:32 1240

原创 sed对文件的写操作

原始数据:$ cat data line 1line 2line 3line 4line 5line 6line 7line 8line 9line 10将第1,2行保存到新文件中:$ sed '1,2w test' dataline 1line 2line 3line 4line 5line 6line 7line 8line 9line 10$ cat

2017-03-22 11:18:04 636

原创 sed命令修改行

原始数据:$ cat data line 1line 2line 3line 4line 5line 6line 7line 8line 9line 10修改第三行:$ sed '3c\> this line has been changed.' dataline 1line 2this line has been changed.line 4line 5line

2017-03-22 10:58:21 1052

原创 sed命令删除行操作

原始数据$ cat data line 1line 2line 3line 4line 5line 6line 7line 8line 9line 10删除第3行:$ sed '3d' dataline 1line 2line 4line 5line 6line 7line 8line 9line 10注意,此时data本身没有改变,删除2,3行:$ sed '

2017-03-22 10:30:51 10243

原创 判断一个整数是否能被11整除

如果一个整数在整型范围内,那么这个题目就很简单了,直接用求余符号就能搞定,但是如果这个整数比较大怎么办呢?传说有一种神奇的算法叫做“奇偶位差法”,啥意思呢,就是在奇数位上的数字和与偶数位上的数字和做差,如果这个差的绝对值能被11整除,那么这个数字就可以被11整除。举个栗子:11奇数位:1偶数位:1差的绝对值:1-1=0因为0%11=0,所以11可以被11整除1837奇数位和:7+8=15

2017-03-21 16:00:18 10214

原创 /usr/bin/env: ‘node’: No such file or directory

解决办法:ln -s /usr/bin/nodejs /usr/bin/node

2017-03-17 16:25:25 1776

原创 利用Python下载文件

利用Python下载文件也是十分方便的:小文件下载下载小文件的话考虑的因素比较少,给了链接直接下载就好了:import requestsimage_url = "https://www.python.org/static/community_logos/python-logo-master-v3-TM.png"r = requests.get(image_url) # create HTTP re

2017-03-16 16:32:47 46730 3

原创 bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: html5lib

使用BeautifulSoup的时候提示以下错误:bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: html5lib. Do you need to install a parser library?解决方案:pip install html5lib

2017-03-16 16:22:16 6411

原创 利用Python对文件进行解压缩

对文件进行解压缩是我们日常工作中最平常不过的行为了,压缩过的文件不仅可以节省磁盘空间,而且在网络传输中也可以节省不少时间。Python为我们提供了zipfile模块,这使得我们可以十分方便地对文件进行解压缩操作,而且代码书写也十分简单:对文件进行压缩:from zipfile import ZipFileimport osdef get_all_file_paths(directory):

2017-03-16 15:32:55 8437

翻译 朴素贝叶斯分类器(Naive Bayes Classifiers)

原文地址:Naive Bayes Classifiers 本文讨论的是朴素贝叶斯分类器( Naive Bayes classifiers)背后的理论以及其的实现。朴素贝叶斯分类器是分类算法集合中基于贝叶斯理论的一种算法。它不是单一存在的,而是一个算法家族,在这个算法家族中它们都有共同的规则。例如每个被分类的特征对与其他的特征对都是相互独立的。开始之前,先看一下数据集。这是一个虚构的数据集,这个

2017-03-03 15:22:04 53167 6

原创 在一个数组中找到三元组,使得三元组内的三个元素加和为0。

这是一道Google面试题目,题目比较容易理解:看例子:Input : arr[] = {0, -1, 2, -3, 1}Output : 0 -1 1 2 -3 1Input : arr[] = {1, -2, 1, 0, 5}Output : 1 -2 1其中一个最简单的想法就是3层循环,对数组进行遍历,找到加和等于0的三个元素,但是这个方法时间复杂度是O(n3)O(n^

2017-03-03 11:31:14 7282

原创 Linux下环境变量PATH设置错误,导致命令都找不到

吓人啊,PATH设置出错,所有的命令全部找到不到了,提示说在/usr/bin/下面可以找到,课时cd过去以后还是不行。系统里面各种配置,各种下载,这是逼我重装系统吗?虽说是虚拟机,但也足够喝一壶了!幸亏export命令还能用:export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin这样所有的命令就都回来了,如果以

2017-03-02 16:56:28 10942 5

原创 Ubuntu下安装MySQL出错(dpkg: dependency problems prevent configuration of mysql-community-server)

安装MySQL最后一步,输入命令:sudo dpkg -i mysql-{common,community-client,client,community-server,server}_*.deb输出:(Reading database ... 160146 files and directories currently installed.)Preparing to unpack mysql-c

2017-03-02 13:41:48 10180 1

OSGi in Action

HIGHLIGHT OSGi in Action is the definitive guide to OSGi, the hottest technology available for creating modular enterprise Java applications. DESCRIPTION What is OSGi? Simply put, OSGi is a standardized technology that allows developers to create the highly modular Java applications that are required for enterprise development. OSGi lets you install, start, stop, update, or uninstall components without taking down your entire system. The interest in OSGibased applications has exploded since major vendors like Sun, Spring, Oracle, BEA, and IBM have gotten behind the standard. OSGi in Action is a comprehensive guide to OSGi with two primary goals. First, it provides a clear introduction to OSGi concepts with examples that are relevant both for architects and developers. Then, it explores numerous practical scenarios and techniques, answering questions like: How much of OSGi do you actually need? How do you embed OSGi inside other containers? What are the best practices for moving legacy systems to OSGi? KEY POINTS Highly-visible authors and reviewers are core members of OSGI community. This book is based on hands-on experience with OSGI. Authors have contributed to high-profile OSGi implementations, including Apache Felix.

2017-10-05

C++编程思想 两卷合订本

(美)Bruce Eckel 著 刘宗田 袁兆山 潘秋菱 等译

2017-10-01

iOS编程 第四版

作者[美] Christian Keur / [美] Aaron Hillegass / [美] Joe Conway

2017-10-01

apt-mirror-api-0.1.jar

Files contained in apt-mirror-api-0.1.jar: META-INF/MANIFEST.MF META-INF/maven/com.moparisthebest.aptIn16/apt-mirror-api/pom.properties META-INF/maven/com.moparisthebest.aptIn16/apt-mirror-api/pom.xml com.sun.mirror.apt.AnnotationProcessor.class com.sun.mirror.apt.AnnotationProcessorEnvironment.class com.sun.mirror.apt.AnnotationProcessorFactory.class com.sun.mirror.apt.AnnotationProcessorListener.class com.sun.mirror.apt.AnnotationProcessors.class com.sun.mirror.apt.Filer.class com.sun.mirror.apt.Messager.class com.sun.mirror.apt.RoundCompleteEvent.class com.sun.mirror.apt.RoundCompleteListener.class com.sun.mirror.apt.RoundState.class com.sun.mirror.declaration.AnnotationMirror.class com.sun.mirror.declaration.AnnotationTypeDeclaration.class com.sun.mirror.declaration.AnnotationTypeElementDeclaration.class com.sun.mirror.declaration.AnnotationValue.class com.sun.mirror.declaration.ClassDeclaration.class com.sun.mirror.declaration.ConstructorDeclaration.class com.sun.mirror.declaration.Declaration.class com.sun.mirror.declaration.EnumConstantDeclaration.class com.sun.mirror.declaration.EnumDeclaration.class com.sun.mirror.declaration.ExecutableDeclaration.class com.sun.mirror.declaration.FieldDeclaration.class com.sun.mirror.declaration.InterfaceDeclaration.class com.sun.mirror.declaration.MemberDeclaration.class com.sun.mirror.declaration.MethodDeclaration.class com.sun.mirror.declaration.Modifier.class com.sun.mirror.declaration.PackageDeclaration.class com.sun.mirror.declaration.ParameterDeclaration.class com.sun.mirror.declaration.TypeDeclaration.class com.sun.mirror.declaration.TypeParameterDeclaration.class com.sun.mirror.type.AnnotationType.class com.sun.mirror.type.ArrayType.class com.sun.mirror.type.ClassType.class com.sun.mirror.type.DeclaredType.class com.sun.mirror.type.EnumType.class com.sun.mirror.type.InterfaceType.class com.sun.mirror.type.MirroredTypeException.class com.sun.mirror.type.MirroredTypesException.class com.sun.mirror.type.PrimitiveType.class com.sun.mirror.type.ReferenceType.class com.sun.mirror.type.TypeMirror.class com.sun.mirror.type.TypeVariable.class com.sun.mirror.type.VoidType.class com.sun.mirror.type.WildcardType.class com.sun.mirror.util.DeclarationFilter.class com.sun.mirror.util.DeclarationScanner.class com.sun.mirror.util.DeclarationVisitor.class com.sun.mirror.util.DeclarationVisitors.class com.sun.mirror.util.Declarations.class com.sun.mirror.util.SimpleDeclarationVisitor.class com.sun.mirror.util.SimpleTypeVisitor.class com.sun.mirror.util.SourceOrderDeclScanner.class com.sun.mirror.util.SourcePosition.class com.sun.mirror.util.TypeVisitor.class com.sun.mirror.util.Types.class

2016-11-15

《Java编程思想 第四版》源码

《Java编程思想 第四版》源码

2016-11-15

空空如也

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

TA关注的人

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