- 博客(47)
- 资源 (3)
- 收藏
- 关注
原创 Mac上设置 使用终端打开sublime text
记录配置过程:使用sublime提供的命令行工具。这个命令行工具位于/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl,缺省情况下这个命令不在$PATH环境中,需要通过下面这个命令做个符号链接。执行ln -s /Applications/Sublime\ Text\ 2.app/Contents/Share
2015-08-25 14:19:27
1095
原创 mac10.10上安装lxml
安装scrapy过程中 安装lxml始终报错:In file included from src/lxml/lxml.etree.c:239: /private/tmp/pip-build-2WNYG9/lxml/src/lxml/includes/etree_defs.h:14:10: fatal error: 'libxml/xmlversion.h' file not fo
2015-08-14 16:00:29
791
原创 网络爬虫整理
最近在为自己搭建的网站忙碌,记录下爬虫资料除了基础的利用python re,beautifulsoup爬取之外,可以连接mysql 数据库将爬取信息导入数据库,例子如下:-*- coding: utf-8 -*-import MySQLdb as mdbimport systry: con=mdb.connect('localhost','user','password','
2015-02-07 10:59:19
473
原创 记录ubuntu安装python科学计算工具包numpy
sudo apt-get install python-scipysudo apt-get install python-numpysudo apt-get install python-matplotlibpython
2014-11-13 23:22:59
551
转载 JUNIT在Eclipse中的使用
我们在编写大型程序的时候,需要写成千上万个方法或函数,这些函数的功能可能很强大,但我们在程序中只用到该函数的一小部分功能,并且经过调试可以确定,这一小部分功能是正确的。但是,我们同时应该确保每一个函数都完全正确,因为如果我们今后如果对程序进行扩展,用到了某个函数的其他功能,而这个功能有bug的话,那绝对是一件非常郁闷的事情。所以说,每编写完一个函数之后,都应该对这个函数的方方面面进行测试,这样的测
2014-07-09 10:04:25
480
转载 Maven入门学习
这个入门篇分上下两篇。本文着重动手,用 maven 来构建运行 hellow world 程序,体会一下不用任何 IDE ,只用 maven 是咋回事。然后下篇就讲解一下 maven 的核心概念。写这两篇文章特意回避了复杂的示例,也不使用 IDE ,目的是排除干扰,着重于 maven 本身。本文的源代码可从这里下载。 Apache Maven 是做什么用的?Maven 是一个项目
2014-07-09 09:41:57
402
原创 自动为Myeclipse添加作者等信息
windows-->preferenceJava-->Code Style-->Code Templatescode-->new Java files编辑它${filecomment}${package_declaration}/*** @author 作者 E-mail:* @version 创建时间:${date} ${time}* 类说明*/
2014-07-08 16:08:14
941
转载 Spring配置Quartz任务调度框架教程
原文地址:http://blog.youkuaiyun.com/yuebinghaoyuan/article/details/9049391在J2EE中Spring与Quartz的配置使用。 在操作时,注意版本问题,上篇博客也提到,Quartz中1.8版本中的JobDetail,SimpleTrigger,CornTrigger都是类,而在2.0.2版本中都是接口。若在与spring结合时
2014-07-08 15:41:53
378
转载 Java泛型总结
下面是一些有关Java泛型的总结:原文地址:http://developer.51cto.com/art/200909/153983.htm普通泛型class Point{ // 此处可以随便写标识符号,T是type的简称 private T var ; // var的类型由T指定,即:由外部指定 public T getVar(){ // 返回值的类型由外部决定
2014-07-03 11:06:13
346
转载 MyEclipse中添加User Library(区别于referenced libraries)
在MyEclipse中有两种常用的添加引用的jar包的方法,一个就是添加Referenced Library,这种方式很简单,出选中项目右键->import之外,还可以直接向WebRoot->WEB-INF->lib中复制粘贴jar包文件,缺点是下次添加同样的jar包时任然要这样找到jar包文件,然后重复工作。第二个就是添加User Library,具体做法如下:1. 选中工程右键->build
2014-07-02 15:50:37
619
转载 json知识总结
Java构造和解析Json数据的两种方法详解一 在www.json.org上公布了很多JAVA下的json构造和解析工具,其中org.json和json-lib比较简单,两者使用上差不多但还是有些区别。下面首先介绍用json-lib构造和解析Json数据的方法示例。 用org.son构造和解析Json数据的方法详解请参见我下一篇博文:Java构造和解析J
2014-07-02 14:49:31
424
转载 hashSet,hashMap,hashTable总结
yua(1)HashSet是set的一个实现类,hashMap是Map的一个实现类,同时hashMap是hashTable的替代品(为什么后面会讲到).(2)HashSet以对象作为元素,而HashMap以(key-value)的一组对象作为元素,且HashSet拒绝接受重复的对象.HashMap可以看作三个视图:key的Set,value的Collection,Ent
2014-07-02 14:18:20
458
转载 scanner学习
java.util包原文地址:http://blog.youkuaiyun.com/zsw2zkl/article/details/72103701)首先记住它的8中构造方法同PrintWriter类Scanner类同样可以直接对文件进行操作Scanner(File source) 构造一个新的 Scanner,它生成的值是从指定文件扫描的,底层平台的默认字符集转换成字符。 Scanne
2014-06-24 11:15:09
477
转载 转:Shell 编程--本文结合大量实例阐述如何编写一个shell脚本。
转自:情報官世界 本文结合大量实例阐述如何编写一个shell脚本。 为什么要进行shell编程 在Linux系统中,虽然有各种各样的图形化接口工具,但是sell仍然是一个非常灵活的工具。Shell不仅仅是命令的收集,而且是一门非常棒的编程语言。您可以通过使用shell使大量的任务自动化,shell特别擅长系统管理任务,尤其适合那些易用性、可维护性和便携性比效率更重要的
2014-06-19 15:39:11
502
转载 ${pageContext.request.contextPath}
JSP中究竟采用绝对路径还是采用相对路径随着所采用技术的越来越复杂,这个问题也变得越来越难以解决。 1)采用相对路径遇到的问题 l 相对路径固然比较灵活,但如果想复制页面内的代码却变得比较困难,因为不同的页面具有不同的相对路径,复制后必须修改每一个连接的路径。 l 如果页面被多于一个的页面所包含,那么被包含页面中的相对路径将是不正确的。 l
2014-06-19 10:12:45
365
转载 getHibernateTemplate()与getSession()方法的区别
自动生成hibernate配置文件的时候,会在dao层用到getSession()方法来操作数据库记录,但是他还有个方法getHibernateTemplate(),这两个方法究竟有什么区别呢?1.使用getSession()方法你只要继承sessionFactory,而使用getHibernateTemplate()方法必须继承 HibernateDaoSupport当然包括sessionF
2014-06-11 10:55:53
551
原创 定义serialVersionUID的作用与意义整理
实现java.io.Serializable这个接口是为序列化,serialVersionUID 用来表明实现序列化类的不同版本间的兼容性。如果你修改了此类, 要修改此值。否则以前用老版本的类序列化的类恢复时会出错。实现后如果你用的是工具的话会出来警告,他会提示你,可以自动生成private static final long serialVersionUID = 1L; 为了在反序列
2014-06-11 10:41:48
8422
原创 javax.servlet.jsp.pagecontext cannot be resolved to a type异常记录
导入一个项目,Myeclipse报错:javax.servlet.jsp.pagecontext cannot be resolved to a type
2014-06-11 09:05:02
895
原创 leetcode17.PalindromePartitioning
java:package leetcode15.PalindromePartitioning;import java.util.ArrayList;import java.util.Hashtable;public class Solution { public static void main(String[]args){ String s="aab"; System
2014-06-05 10:38:39
422
原创 leetcode16.cloneGraph
java:package leetcode14.cloneGraph;import java.util.ArrayList;import java.util.Hashtable;import java.util.LinkedList;class UndirectedGraphNode{ int label; ArrayList neighbors; UndirectedGr
2014-06-05 10:37:09
341
原创 leetcode15.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
2014-06-05 09:20:57
527
原创 leetcode14.gasStation
问题描述如下:There are N gas stations along a circular route, where the amount of gas at stationi is gas[i].You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from stati
2014-06-05 09:18:59
542
原创 leetcode13.singleNumber
问题描述:Given an array of integers, every element appears three times except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it withou
2014-06-05 09:16:14
472
转载 leetcode12.wordBreak
代码如下:package leetcode10.WordBreak;import java.util.HashSet;import java.util.LinkedHashSet;import java.util.Set;/**Word Break Given a string s and a dictionary of words dict, determine if s
2014-05-30 09:16:45
499
原创 leetcode11.Linked List Cycle II
问题比之前的那个问题麻烦了点iven a linked list, return the node where the cycle begins. If there is no cycle, return null.Follow up:Can you solve it without using extra space?
2014-05-29 14:07:13
553
原创 leetcode10.Linked List Cycle
问题如下:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?意思就是用
2014-05-29 12:41:44
604
原创 Leetcode9.reorder List
Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For example,given 1234 --> 1423jie
2014-05-29 11:21:14
475
转载 leetcode7.binary tree前序遍历
题目:http://oj.leetcode.com/problems/binary-tree-preorder-traversal/Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \
2014-05-29 09:06:41
552
转载 leetcode6.LRU Cache
原文地址:http://blog.youkuaiyun.com/whuwangyi/article/details/15495845实现代码: class Node { Node prev; Node next; SimpleEntry entry; } private Node head = null; private HashMap map = new HashMap();
2014-05-21 15:02:04
337
原创 leetcode5:Insertion Sort Link
问题如下:Sort a linked list using insertion sort.定义节点类
2014-05-21 12:32:50
336
转载 leetcode 难度及频率 所用数据结构
LeetCode Question Difficulty Distribution : Sheet1 IDQuestionDiffFreqData StructureAlgorithms
2014-05-19 15:08:53
1163
转载 Leetcode3: Max Points on a Line
/** * Definition for a point. * class Point { * int x; * int y; * Point() { x = 0; y = 0; } * Point(int a, int b) { x = a; y = b; } * } */public class Solution { public in
2014-05-19 14:59:48
351
原创 leetcode1:Reverse Words in a String
问题如下Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".java程序如下:package leetcode1.ReverseWordsinAString;public cl
2014-05-19 13:00:25
434
原创 leetcode.2:Reverse Polish Notation
Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another expression.Some examples: ["2", "1", "+",
2014-05-19 11:11:12
379
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人