自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 UML类图入门级介绍

首先上一张经典的图首先,看动物矩形框,它表示一个类(Class)。类分三层,第一层显示类的名称,如果是抽象类,则用斜体字显示。第二层是类的特性,通常就是字段和属性。第三层是类的操作,通常是方法或行为。前面的符号,+表示public,-表示private,#表示protected。左下角的飞翔,它表示一个接口(interface)。与类的区别主要是顶端的>显示。第一行是接口名称,第二

2017-11-30 09:15:21 366

原创 ubuntu重装与挂载

之前在电脑的ssd上装了window10+ubuntu16.04双系统。今天从grub引导进入windows后它说有问题要修复,可能需要重启几次。然后重启了一两次后就黑屏了。屏幕显示error:no such partitiongrub rescue>我就感觉大事不妙,然后用PE盘进入系统一看,万恶的windows把我分给ubuntu的那一块儿分区给格了!!!怪不得不能grub然后用

2017-11-26 20:38:55 1219

原创 Android Studio若干问题

1.can‘t change emulated performance of AVD in Android Studiosolution:Actually, this problem seems to be limited to devices with Play Store available, so Nexus 5X and Nexus 5 images will be forced to

2017-10-16 14:40:11 1900

原创 IntelliJ says 'cannot run program '/path/to/tomcat/bin/catalina.sh' error=13 permission denied

解决办法chmod a+x /path/to/tomcat/bin/catalina.sh

2017-10-16 14:38:41 1948

原创 Address localhost: 1099 is already in use问题解决

首先查看哪个端口被占用netstat -apn | grep 1099可见,进程号是17185若要查看此进程详细信息,则:ps -aux | grep 17185然后将这个进程杀死即可kill 17185

2017-10-16 14:28:06 1699

原创 good link

sublime+C++: http://www.cnblogs.com/flipped/p/5836002.html

2017-10-15 20:21:24 311

原创 Dijkstra's Algorithm(迪杰斯特拉算法)

#include using namespace std; const int maxnum = 100;const int maxint = 999999; int dist[maxnum]; // 表示当前点到源点的最短路径长度int prev[maxnum]; // 记录当前点的前一个结点int c[maxnum][maxnum]; // 记录图的两点间路

2017-09-13 20:04:53 380

原创 笔记_1

---C++先输入n然后输入元素个数为n的数组的值int main(){ int n; while (cin>>n) { int* arr = new int[n]; for (int i = 0; i < n; i++) { cin >> arr[i]; } }}

2017-07-26 19:43:07 244

原创 Java面试题全集学习笔记

学习资料来自:http://blog.csdn.net/jackfrued/article/details/44921941/第7题!class AutoUnboxingTest { public static void main(String[] args) { Integer a = new Integer(3); Integer b =

2017-07-26 09:26:44 401

原创 Java中的String,StringBuffer,StringBuilder

StringString是字符串常量,Java中String是immutable(不可变的)。String类中的定义:/** The value is used for character storage. */ private final char value[]; /** The offset is the first index of the storag

2017-07-17 20:05:44 336 1

原创 Java接口与Java抽象类的区别

1)Java接口和Java抽象类最大的一个区别,就在于Java抽象类可以提供某些方法的部分实现,而Java接口不可以,这大概就是Java抽象类唯一的有点吧,但是这个优点非常有用。如果向一个抽象类里家一个新的具体方法,那么它所有的子类都一下子的到了这个新方法,而Java接口做不到这一点。如果向一个Java接口里加入一个新方法,所有实现这个接口的类就无法通过编译了,因为必须让没一个类都再实现这个方

2017-07-16 22:30:16 198

原创 Java中的this与super

this先上例子public class A { int i; A(){ add(1); System.out.println(i); } void add(int v){ i += v; System.out.println(i); }}public class B exte

2017-07-16 22:02:21 204

原创 Java继承的两个小例子

首先上代码public class A { protected String value = "123"; public A(){ System.out.println("A"); } public String getValue(){ return value; }}public class B extends

2017-07-15 16:05:35 1706

原创 Ubuntu16.04安装后的工作

安装Ubuntu后要配置一个适合自己的开发环境,还有很多工作要做,在此做一下记录,也使有需要的人有个参考。首先需要设置root密码,输入命令sudo passwd而后输入安装时的用户密码,再输入两次你想设置的root密码即可完成。下载安装中文输入法,在此我推荐google拼音sudo apt-get install language-pack-zh-hans  //这条命令安装

2017-07-15 14:17:49 780

原创 Java内存管理的堆和栈

栈有一个很重要的特殊性,就是存在栈中的数据可以共享。假设我们同事定义:int a = 3;int b = 3;编译器先处理int a = 3;首先它会在栈中创建一个变量为a的引用,然后查找栈中是否有3这个值,如果没找到,就将3存放进来,然后将a指向3.接着处理int b = 3;在创建完b的引用变量后因为在栈中已经有3这个值,便将b直接指向3。这样就出现了a与b同事指向3的

2017-07-14 17:11:36 214

转载 Java中的Map遍历

在Map集合中values():获取集合中的所有的值,没有键,没有对应关系;KeySet():将Map中所有的键存入到Set集合中。因为Set具备迭代器,所以可以用迭代方式取出所有的键,再根据get方法,获取每一个键对应的值。entrySet():Set> entrySet()返回此映射中包含的映射关系的Set视图。Map.Entry表示映射关系。entrySet():迭代后可

2017-07-04 16:48:36 169

原创 深度优先遍历之树边,前向边,回边,横跨边

根据在有向图G上进行深度优先遍历所产生的深度优先森林,可以把图中的边分为四类:(1)树边:是DFS森林的实际组成部分。如果顶点v是在探测边(u,v)时首次被发现的,那么(u,v)就是一条树边。(2)前向边::是DFS树中从一个顶点指向该顶点的一个非子顶点后裔的边。(3)回边:是DFS树中从一个顶点指向其祖先的边(有向图中可能出现的自环也被认为是反向边)。(4)横跨边:既不是从一个顶

2017-06-15 11:40:57 12390

原创 Leetcode 451. Sort Characters By Frequency

题目:Given a string, sort it in decreasing order based on the frequency of characters.Example 1:Input:"tree"Output:"eert"Explanation:'e' appears twice while 'r' and 't' both appear once.

2017-06-13 17:40:06 302

原创 《算法概论》习题8.19证明

题目:所谓风筝图是这样的,其顶点数为偶数(比如2n),且其中的n个顶点构成了一个团,剩余的n个顶点则由一条称为“尾巴”的路径连接,尾巴的某个端点与团中一个顶点相连。给定一个图和目标g,风筝图问题要求该图的一个包含2g个顶点的风筝子图。请证明该问题是NP-完全的。证明:我们可以将团问题归约到风筝图问题。团问题的目标是求出某图的一个包含g个顶点的完全子图。现设无向图G = (V, E)

2017-06-13 15:13:34 342

原创 Sicily 1198 Substring

题目:ConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionDr lee cuts a string S into N pieces,s[1],…,s[N].   Now, Dr lee gives you these N sub-strings: s[1],…s[N]. There might be s

2017-06-09 16:53:26 223

原创 Sicily 1024. Magic Island

题目:ConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionThere are N cities and N-1 roads in Magic-Island. You can go from one city to any other. One road only connects two cities.

2017-06-02 21:53:42 245

原创 Sicily 1936. Knight Moves

题目:ConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionA friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of k

2017-06-02 15:28:27 299

原创 Sicily 1028. Hanoi Tower Sequence

题目:ConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionHanoi Tower is a famous game invented by the French mathematician Edourard Lucas in 1883. We are given a tower of n disks,

2017-05-31 22:52:15 205

原创 Sicily 1211. 商人的宣传

题目:ConstraintsTime Limit: 1 secs, Memory Limit: 32 MB Description Bruce是K国的商人,他在A州成立了自己的公司,这次他的公司生产出了一批性能很好的产品,准备宣传活动开始后的第L天到达B州进行新品拍卖,期间Bruce打算将产品拿到各个州去做推销宣传,以增加其影响力。K国有很多个州,每个州都与其他一些州相

2017-05-31 22:19:10 219

转载 ParameterizedType获取java泛型参数类型

这两天在看以前写的ssh项目时,遇到一个问题就是封装的BaseDaoImpl抽象类,构造方法里面是这样写的Class clazz;public BaseDaoImpl(){ ParameterizedType pt = (ParameterizedType)getClass().getGenericSuperclass(); clazz = (Class)pt.getActu

2017-05-28 21:58:44 322

转载 Java的PO.VO.DAO等类名包名解释

VO:值对象、视图对象PO:持久对象QO:查询对象DAO:数据访问对象——同时还有DAO模式DTO:数据传输对象——同时还有DTO模式PO:全称是persistant object持久对象最形象的理解就是一个PO就是数据库中的一条记录。好处是可以把一条记录作为一个对象处理,可以方便的转为其它对象。BO:全称是business object:业务对象主要作用是把业

2017-05-25 20:42:23 372

原创 ubuntu的Files资源管理器打不开解决方案

之前安装一个软件中途可能依赖包的问题导致安装失败之后就没管。后来发现Files打不开了,查看计算机中的文件只能用命令行了。虽然也不影响啥,但是想预览一些图片时就比较不方便。本来想用命令ps -A | grep nautilus查看进程id并将其杀掉,然而发现此进程并没有在运行,然后我删掉nautilus重新安装,命令行敲入naultilus时却报出错误,GLib-GIO-ERROR然后我就

2017-05-25 16:12:51 10572 2

原创 IntelliJ IDEA新建Maven项目及部署至tomcat 以及JmxAdminException错误解决方案

在看网上的教程时,

2017-05-25 15:56:18 1893

转载 关于XML文档的xmlns、xmlns:xsi和xsi:schemaLocation

先来一段spring的XML样本:<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/

2017-05-24 21:15:09 323

原创 Sicily 1001. Alphacode

ConstraintsTime Limit: 1 secs, Memory Limit: 32 MB DescriptionAlice and Bob need to send secret messages to each other and are discussing ways to encode theirmessages: Alice: "Let's just use a

2017-05-21 10:03:41 192

原创 Leetcode 486. Predict the Winner

题目:Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and then player 1 and so on. Each time a player

2017-05-15 17:29:40 268

原创 Leetcode 516. Longest Palindromic Subsequence

题目:Given a string s, find the longest palindromic subsequence's length in s. You may assume that the maximum length of s is 1000.思路:动态规划。设一个n行n列的dp数组,n为s的长度。dp[i][j]表示字符串i到j下标所构成的子串中最长回文子序列的长度。最

2017-05-09 18:49:12 173

原创 Leetcode 121. Best Time to Buy and Sell Stock

题目:Say you have an array for which the ith element is the price of a given stock on dayi.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the s

2017-05-09 16:59:26 176

原创 Leetcode 312. Burst Balloons

题目:Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by arraynums. You are asked to burst all the balloons. If the you burst ballooni you will ge

2017-05-09 16:45:12 260

原创 Leetcode 97. Interleaving String

题目:Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = "aabcc",s2 = "dbbca",When s3 = "aadbbcbcac", return true.When s3 = "aadbbba

2017-04-22 21:35:44 212

原创 Leetcode 32. Longest Valid Parentheses

题目:Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the longest valid parentheses substring is "()

2017-04-14 20:11:26 221

原创 Leetcode 301. Remove Invalid Parentheses

题目:Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results.Note: The input string may contain letters other than the parentheses ( a

2017-04-05 22:04:25 281

原创 C++中的‘’和“”

单引号对包括的只能是单个字符,表示一个字符,没有其他任何东西。在存储器中只占用存放一个字母所需的空间。双引号对包括的是一个字符串,字符串的结尾必须以'\0'字符作为结尾标志。如果包括的是单个字符,表示这个字符串只有一个字符成员,再包括末尾的'\0'字符作为结尾标志,这样在存储器中实际占用存放两个字母所需的空间。

2017-04-05 21:30:56 589

原创 Hibernate中英文查询成功中文查询失败

最近在用SSH框架做一个简单的项目。但在web页面用中文关键字搜索时没有任何搜索结果,但是换用英文关键字时结果正常。百思不得其解!我的jsp页面是utf-8,url编解码也是utf-8,mysql数据库也是utf-8。由于用的是tomcat服务器,也去server.xml中进行了修改URIEncoding="UTF-8"。然而还是不成功,最终发现问题出在连接mysql用的url没有指定字符集。

2017-04-05 21:21:25 582

原创 Leetcode 135. Candy

题目: There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requirements:Each child must have at

2017-03-31 19:39:12 248

空空如也

空空如也

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

TA关注的人

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