- 博客(73)
- 资源 (2)
- 收藏
- 关注
原创 微软2016校园招聘在线笔试: [Islands Travel]
时间限制:10000ms单点时限:1000ms内存限制:256MB描述There are N islands on a planet whose coordinates are (X1, Y1), (X2, Y2), (X3, Y3) ..., (XN, YN). You starts at the 1st island (X1, Y1) a
2015-04-04 23:16:32
1673
转载 HashMap的工作原理
HashMap的工作原理是近年来常见的Java面试题。几乎每个Java程序员都知道HashMap,都知道哪里要用HashMap,知道Hashtable和HashMap之间的区别,那么为何这道面试题如此特殊呢?是因为这道题考察的深度很深。这题经常出现在高级或中高级面试中。投资银行更喜欢问这个问题,甚至会要求你实现HashMap来考察你的编程能力。ConcurrentHashMap和其它同步集合的引入
2015-03-12 16:05:46
513
原创 [LeetCode] Department Highest & Top 3 Salary - SQL
The Employee table holds all employees. Every employee has an Id, a salary, and there is also a column for the department Id.+----+-------+--------+--------------+| Id | Name | Salary | Department
2015-03-10 21:56:35
793
原创 [LeetCode] Rank Scores - SQL
Write a SQL query to rank scores. If there is a tie between two scores, both should have the same ranking. Note that after a tie, the next ranking number should be the next consecutive integer value.
2015-03-10 21:18:19
966
原创 [LeetCode] Consecutive Numbers - SQL
Write a SQL query to find all numbers that appear at least three times consecutively.+----+-----+| Id | Num |+----+-----+| 1 | 1 || 2 | 1 || 3 | 1 || 4 | 2 || 5 | 1 || 6 | 2
2015-03-10 20:38:50
1221
原创 [LeetCode] Minimum Window Substring
Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example,S = "ADOBECODEBANC"T = "ABC"Minimum window is "BANC"
2015-03-10 11:30:41
490
转载 8张图理解Java
1. 字符串不变性Here are a set of diagrams to illustrate Java String's immutability.1. Declare a stringString s = "abcd";s stores the reference of the string object. The arrow below should be i
2015-03-09 21:55:39
417
原创 Linux升级Python
1。下载python3.3安装包:wget http://www.python.org/ftp/python/3.4.2/Python-3.4.2.tgz 2。解压安装包:tar -zxvf Python-3.4.2.tgz 3。进入解压后目录:cd Python-3.4.2 4。创建安装目录:mkdir /usr/local/python3
2015-01-30 16:09:21
433
原创 SSH连接Linux
ssh user_name@ip1、从服务器上下载文件scp username@servername:/path/filename /var/www/local_dir(本地目录) 例如scp root@192.168.0.101:/var/www/test.txt 把192.168.0.101上的/var/www/test.txt 的文件下载到/var/www/local_
2015-01-30 14:09:01
410
原创 Java 格式化输出
public class Printf { public static void main(String[] args) { // %s表示输出字符串,也就是将后面的字符串替换模式中的%s System.out.printf("%s", new Integer(1212)); // %n表示换行 System.out.printf("%s%n", "end line
2014-12-22 14:30:15
519
原创 LeetCode: Copy List with Random Pointer题解
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy of the list.public RandomListNode co
2014-12-16 13:35:40
775
原创 Linked List Cycle && Linked List Cycle II 解体思路
Problem I:Given a linked list, determine if it has a cycle in it.Follow up: Can you solve it without using extra space?Problem II:Given a linked list, return the node where the cycle b
2014-12-13 19:22:29
480
原创 大规模分布式存储系统-读书笔记-第一章
分布式存储系统是大量普通PC服务器通过Internet互联,对外作为一个整体提供存储服务。特性:可扩展;低成本;高性能;易用。技术:数据分布;一致性;容错;负载均衡;事务与并发控制;易用性;压缩/解压缩。数据分类非结构化数据:文档、文本、图片、音频、视频结构化数据:关系数据半结构化数据分布式文件系统非结构化数据对象
2014-12-08 16:06:44
881
转载 The Knapsack problem
I found the Knapsack problem tricky and interesting at the same time. I am sure if you are visiting this page, you already know the problem statement but just for the sake of completion :Problem:
2014-10-29 12:53:24
890
原创 Mac 下配置php环境
Mac OS X 内置了Apache 和 PHP,这样使用起来非常方便。本文以Mac OS X 10.6.3为例。主要内容包括:启动Apache运行PHP安装MySQL使用phpMyAdmin配置PHP的MCrypt扩展库设置虚拟主机启动Apache 有两种方法:打开“系统设置偏好(System Preferences
2014-10-08 14:47:24
807
转载 Vim 常用命令
Vim 是从 vi 发展出来的一个文本编辑器。代码补完、编译及错误跳转等方便编程的功能特别丰富,在程序员中被广泛使用。和 Emacs 并列成为类 Unix 系统用户最喜欢的编辑器。这里收录了130+程序员必备的 vim 命令,帮助你提高开发效率。Basics:e filenameOpen filename for edition:wSave file
2014-08-27 21:03:07
506
转载 Lucene实战
更新:下面的代码使用Lucene 4.0版本!Lucene大大简化了在应用中集成全文搜索的功能。但实际上Lucene十分简单,我可以在五分钟之内向你展示如何使用Lucene。1. 建立索引为了简单起见,我们下面为一些字符串创建内存索引:1234567891011
2014-08-19 10:05:57
615
转载 Git图形化参考手册
基本用法上面的四条命令在工作目录、暂存目录(也叫做索引)和仓库之间复制文件。● git add files 把当前文件放入暂存区域。● git commit 给暂存区域生成快照并提交。● git reset -- files 用来撤销最后一次git add files,你也可以用git reset 撤销所有暂存区域文件。● git checkou
2014-08-01 17:08:51
450
转载 Git远程基本操作命令
Git有很多优势,其中之一就是远程操作非常简便。本文详细介绍5个Git命令,它们的概念和用法,理解了这些内容,你就会完全掌握Git远程操作。git clonegit remotegit fetchgit pullgit push本文针对初级用户,从最简单的讲起,但是需要读者对Git的基本用法有所了解。同时,本文覆盖了上面5个命令的几乎所有的常用用法,所以对于熟练用户也有参考价值。
2014-08-01 16:46:41
645
原创 CAS单点登陆实践
一、概述实现基于CAS的单点登录。CAS的官网:http://www.jasig.org/cas二、演示环境本文演示过程在同一个机器上的(也可以在三台实体机器或者三个的虚拟机上),环境如下:windows7 64位,主机名称:michael-pcJDK 1.6.0_18Tomcat 6.0.29CAS-server-3.4.11、CAS-cl
2014-07-30 11:09:31
914
原创 Mac下配置tomcat
到 apache官方主页 下载 Mac 版本的完整 .gz文件包。解压拷贝到 /Library目录下。1。Mac中 Finder打开 Library的方法新建 Finder窗口 按下 shift +Command+G 输入 /Library 进入 该隐藏目录。ps:这个快捷键非常的有用,一定要记住!2。修改目录权限选中 文件夹 Com
2014-07-28 16:46:00
673
转载 Linux下配置SVN
安装说明系统环境:CentOS-6.3安装方式:yum install (源码安装容易产生版本兼容的问题)安装软件:系统自动下载SVN软件 检查已安装版本#检查是否安装了低版本的SVN[root@localhost /]# rpm -qa subversion#卸载旧版本SVN[root@localhost modules]# yum rem
2014-07-21 15:30:28
479
原创 CentOS下配置Ruby on Rails并部署Redmine
0.git确保已安装了依赖的包:yum install curlyum install curl-develyum install zlib-develyum install openssl-develyum install perlyum install cpioyum install expat-develyum install gettext-devel
2014-07-21 12:35:23
1266
原创 Mac下Ruby on Rails环境配置并配置Redmine
The EssentialsInstall Command Line ToolsInstallion of Command Line Tools for Mavericks has changed from the previous versions, there is now a single command you can run in the terminal to trig
2014-07-16 21:20:55
2124
转载 Windows下配置Ruby on Rails开发环境
一、下载并安装RubyWindows下安装Ruby最好选择 RubyInstaller(一键安装包)。下载地址: http://rubyforge.org/frs/?group_id=167 。我们这里下载目前较新的rubyinstaller-1.9.3-p0.exe 一键安装包。这个安装包除了包含ruby本身,还有许多有用的扩展(比如gems)和 帮助文档。双击安装,安装
2014-07-16 12:20:27
791
转载 Mac下MySQL卸载方法
sudo rm /usr/local/mysqlsudo rm -rf /usr/local/mysql*sudo rm -rf /Library/StartupItems/MySQLCOMsudo rm -rf /Library/PreferencePanes/My*vim /etc/hostconfig (and removed the line MYSQLCOM=-YES-)rm
2014-07-15 15:34:04
482
原创 ubuntu 安装svn
环境:ubuntu12.04LTS1、在终端中直接输入 sudo apt-get install subversion,选择安装即可2、查看版本命令 svnserve --version(更多命令直接键入svnserve --help可查看到)3、查看svnserver是否已启动: netstat -ntlp,可看到svn对应的端口3690(如果没有看见,则证明服务未启动,可使用sv
2014-06-08 13:37:19
437
原创 Hibernate学习笔记(三)Session
Hibernate在对数据库进行操作之前,必须先取得Session实例,相当于JDBC在对数据库操作之前,必须先取得Connection实例, Session是Hibernate操作的基础,它不是设计为线程安全(Thread-safe),一个Session由一个线程来使用。开启SessionSession实例由SessionFactory开启获得,例如:Configur
2014-05-06 13:51:06
609
原创 Hibernate学习笔记(二)基本配置
Hibernate可以使用XML档案或properties档案来配置SessionFactory,默认的配置文件名称为hibernate.cfg.xml或hibernate.properties,使用下面的方式来读入文件以配置Hibernate:Configurationconfig = new Configuration().configure();当您使用new建构Configurat
2014-05-06 13:10:36
650
原创 Hibernate学习笔记(一)O/R 映射入门
Hibernate是ORM的解决方案,其底层对数据库的操作依赖于JDBC,所以您必须先取得JDBC驱动程序,在这边所使用的是MySQL,所以您必 须至 MySQL® Connector/J 取得MySQL的JDBC驱动程序。接下来至 Hibernate官方网站 取得hibernate 3.2。解开zip档案后,当中的hibernate3.jar是必要的,而在lib目录中还包括了
2014-05-06 12:46:38
525
原创 Ubuntu下彻底解决mysql中文乱码
Mysql5.5默认的是客户端和服务器都用了latin1,所以会乱码#vim /etc/mysql/my.cnf
2014-04-22 19:41:05
705
原创 Apache+Tomcat集群部署
1. 部署准备Apache 服务器 下载地址:http://httpd.apache.org/download.cgi 版本2.4Tomcat 下载地址:http://tomcat.apache.org/版本7.0tomcat-connectors-1.2.37-windows-i386-httpd-2.4.x下载地址:http://tomcat.apache.org/dev/dis
2014-03-28 13:40:20
1347
原创 ubuntu下创建桌面快捷方式
1. Ctrl + Alt + T 调出Terminal2. cd /usr/share/applications/3. sudo gedit eclipse:[DesktopEntry]Encoding=UTF-8Name=eclipseComment=Eclipse IDEExec=/usr/local/eclipse/eclipse_SDK/eclipseIc
2014-03-28 13:36:21
507
转载 开源Android APP SlidingMenu环境的部署
github上的jfeinstein10的SlidingMenu就不多说了,地址:https://github.com/jfeinstein10/SlidingMenu,下面记录下如何在eclipse上的部署:1、下载SlidingMenu,地址如上;2、下载ActiongBarsSherlock,地址:http://actionbarsherlock.com/ ;3、解压到各自的文件
2014-03-23 12:18:13
679
转载 Ubuntu下连接Android手机
1、查找手机usb信息(ID) 方法:先拔下手机连接PC的USB线,然后查看USB设备信息,再次插入USB连接线,再次查看USB设备信息,通过比较,查找到自己手机的USB信息。 使用命令:lsusb ubuntu :~$ lsusbBus 002 Device 003: ID 062a:3633 Creative Labs Bus 002 Device 002: ID 8087:0
2014-03-21 10:28:21
746
转载 给Python初学者的一些技巧
以下是我近些年收集的一些Python实用技巧和工具,希望能对你有所帮助。交换变量123456789x=6y=5 x, y =y, x printx>>>5print
2014-03-21 09:03:07
412
原创 64位Ubuntu部署Eclipse_ADT修正ERROR
1. error while loading shared libraries: zlib.so.1: cannot open shared object file: No such file or directorysudo apt-get install lib32z12. error while loading shared libraries: libstdc++.so.6:
2014-03-16 12:00:06
598
原创 Lucene研究笔记
1.Deploy:1)Download:http://lucene.apache.org/2)You need four JARs: the Lucene JAR, the queryparser JAR, the common analysis JAR, and the Lucene demo JAR. You should see the Lucene JAR file in th
2014-03-14 19:13:54
683
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人