volatile关键字相信了解Java多线程的读者都很清楚它的作用。volatile关键字用于声明简单类型变量,如int、float、boolean等数据类型。如果这些简单数据类型声明为volatile,对它们的操作就会变成原子级别的。但这有一定的限制。例如,下面的例子中的n就不是原子级别的:pub...
分类:
其他好文 时间:
2014-10-14 19:50:29
阅读次数:
123
Given a non-negative number represented as an array of digits, plus one to the number.
The digits are stored such that the most significant digit is at the head of the list.
class Solution {
pub...
分类:
其他好文 时间:
2014-10-14 16:04:43
阅读次数:
154
You are climbing a stair case. It takes n steps to reach to the top.
Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
//第一种解法
class Solution {
pub...
分类:
其他好文 时间:
2014-10-13 23:41:27
阅读次数:
393
在终端输入bash -version,我的是3.2.51,现在从http://git.savannah.gnu.org/cgit/bash.git/snapshot /bash-master.tar.gz下载4.3.24,然后解压,再从ftp://ftp.cwru.edu/pub/bash/bash-4.3- patch...
分类:
系统相关 时间:
2014-10-12 03:33:27
阅读次数:
200
sudo apt-get updatesudo apt-get install openssh-server1:ssh-keygen -t rsa -f ~/.ssh/id_rsa这里会提示输入pass phrase,一定不要输入任何字符,回车即可2:cat ~/.ssh/id_rsa.pub >>...
分类:
其他好文 时间:
2014-10-12 01:54:17
阅读次数:
261
前提,机器A,B,均为RedHat Linux操作系统,均有用户user
1、以用户名user登录,在A机器上执行
ssh-genkey -t rsa
一路回车,不需要输入密码
执行该操作将在/home/user/.ssh下生成id_rsa, id_rsa.pub文件,其中id_rsa.pub是公钥。
2、在B机器上做步骤1或自行创建/home/user/.ssh文件夹,注意文件夹权...
分类:
其他好文 时间:
2014-10-11 18:32:05
阅读次数:
229
1.生成公钥和私钥
ssh-keygen-tdsa
2.发送公钥
oldboy888@ser200.ssh]$ssh-copy-id-iid_dsa.pub"-p20000oldboy888@192.168.1.201"
10
Theauthenticityofhost‘192.168.1.201(192.168.1.201)‘can‘tbeestablished.
RSAkeyfingerprintis0a:13:db:54:60:3e:85:46:b5:ea:d5:b9:c0:5e:..
分类:
其他好文 时间:
2014-10-11 10:19:45
阅读次数:
187
第一步:下载jdk-7-linux-i586.tar.gzwget-chttp://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-i586.tar.gz(注:假设下载不下来,建议使用迅雷下载,然后复制到Linux系统上。)第二步:解压安装sud...
分类:
系统相关 时间:
2014-10-10 19:45:56
阅读次数:
251
控制器using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;namespace MvcApplication2.Controllers{ pub...
分类:
Web程序 时间:
2014-10-10 15:24:40
阅读次数:
186
主要类:JavaCompiler FileManagerJavaCompiler .CompilationTaskAbstractProcessor参考代码https://today.java.net/pub/a/today/2008/04/10/source-code-analysis-using...
分类:
编程语言 时间:
2014-10-09 13:44:23
阅读次数:
222