上一页 1 ··· 7 8 9 10 11 12 13 14 下一页

2013年9月10日

Roman to Integer

摘要: Given aroman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999. 1 public class Solution { 2 public int romanToInt(String s) { 3 // Start typing your Java solution below 4 // DO NOT write main() function 5 StringBuffer ss = new Str... 阅读全文

posted @ 2013-09-10 14:05 Step-BY-Step 阅读(148) 评论(0) 推荐(0) 编辑

2013年9月6日

static函数与普通函数

摘要: 转自http://blog.163.com/sunshine_linting/blog/static/44893323201191294825184/全局变量(外部变量)的说明之前再冠以static 就构成了静态的全局变量。全局变量本身就是静态存储方式, 静态全局变量当然也是静态存储方式。这两者在存储方式上并无不同。这两者的区别虽在于非静态全局变量的作用域是整个源程序, 当一个源程序由多个源文件组成时,非静态的全局变量在各个源文件中都是有效的。 而静态全局变量则限制了其作用域, 即只在定义该变量的源文件内有效, 在同一源程序的其它源文件中不能使用它。由于静态全局变量的作用域局限于一个源文件内, 阅读全文

posted @ 2013-09-06 06:31 Step-BY-Step 阅读(549) 评论(0) 推荐(0) 编辑

2013年9月5日

Longest Palindromic Substring

摘要: Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa... 阅读全文

posted @ 2013-09-05 14:45 Step-BY-Step 阅读(257) 评论(0) 推荐(0) 编辑

2013年9月4日

饮食治疗主要强调的三个原则

摘要: 这里所说的饮食治疗主要强调三个原则: 清淡。脂肪肝患者应以低脂饮食为宜,并且尽量只摄取植物性脂肪,尽可能多吃一些单不饱和脂肪酸(如橄榄油、菜籽油、茶油等),尽量少吃一些饱和脂肪酸(如猪油、牛油、羊油、黄油、奶油等),同时限制胆固醇的摄入量,尽量远离动物内脏、蛋黄、鱼卵、鱿鱼等食物。搭配。要注意荤素搭配,同时还要把三大营养素合理地搭配起来,即增加蛋白质的摄入量,重视脂肪的质和量,糖类饮食应适量,限制单糖和双糖的摄入。吃一些低糖类饮食,不能吃高糖糕点、冰淇淋、干枣和糖果等。高纤维类的食物也有助于增加饱腹感,控制血糖和血脂。如玉米麸、糙米、豆类、香菇、木耳、鸭梨等。 定时定量。上班族有的不吃早... 阅读全文

posted @ 2013-09-04 11:38 Step-BY-Step 阅读(203) 评论(0) 推荐(0) 编辑

有氧运动的八大误区

摘要: 有氧运动比力量训练在控制体脂方面效果更好事实:有氧运动与力量训练结合进行是将体脂控制在理想水平的最好方法。许多人出于以下两点理由,错误地以为单独进行有氧锻炼对控制和减少体脂最有效。 ① 有氧运动首先消耗的是脂肪,而力量训练消耗的是储存在体内的糖。 ②在设定的心率范围之内,45分钟的有氧锻炼要比同样时间的力量训练消耗更多的热量,练练停停的力量训练需要每组之间休息,消耗的热量要少得多。道理是这样的:有氧锻炼能达到消耗热量的目的,但却不能长时间地提高新陈代谢率。力量练习虽不能长时间提高心率,但它却增加了肌肉总量,从而使新陈代谢率得到提高,使人在休息时也能消耗更多的热量。这就是有氧锻炼与力量练... 阅读全文

posted @ 2013-09-04 11:27 Step-BY-Step 阅读(260) 评论(0) 推荐(0) 编辑

五式食疗百战百胜

摘要: 第一式全天候戒糖第一式是说除甜食之外,连菜的调味亦不加糖分。陈芷菁说戒糖原因是糖会被人体转化为脂肪吸收,而且越吃得多甜东西便越觉肚饿,无形中会令你多吃,而且不少天然食品中如生果、牛奶,其实都已含有足够人体所需的糖分,如果自己再添加人工糖就会胖起来!第二式5:00PM后戒食淀粉质和水果下午5时之后要戒吃淀粉质(例如饭、面、薯仔类、牛奶和生果)。陈芷菁说因为5时后人体消耗的能量有限,根本耗不尽晚上吸收的糖分,而淀粉质会转为糖被人体吸收,而牛奶中亦有乳糖、生果有果糖,吃了又变成脂肪!第三式少菜汁很多食物本身不会导致肥胖,但其菜汁却会令卡路里即刻倍增!第四式戒吃油一汤匙油有88卡路里,所以煎炸食物少吃 阅读全文

posted @ 2013-09-04 05:38 Step-BY-Step 阅读(120) 评论(0) 推荐(0) 编辑

8个措施甩掉烦人的脂肪肝

摘要: 脂肪肝的致命危害性: 1、形成肝纤维化、肝硬化。肝细胞中脂滴增多,使肝细胞脂肪变性,长期的肝细胞变性会导致肝细胞再生障碍和坏死,进而形成肝纤维化、肝硬化。 2、诱发或加重糖尿病。据调查,糖尿病患者中合并脂肪肝的约50%,脂肪肝患者中合并糖尿病的为30%~40%。 3、妊娠脂肪肝。妊娠脂肪肝多发生于妊娠后期(36~40周),起病急骤、进展迅速、预后极差,死亡率高达80%。 4、诱发肝癌。脂肪肝与原发性肝癌的发生虽无直接关系,但是脂肪肝的病因,如饮酒、营养不良、药物作用及有毒物质损害等,可诱发肝癌。因此,脂肪肝也可增加肝癌的发病几率。 5、诱发或加重高血压、冠心病、动脉粥样硬化。脂肪... 阅读全文

posted @ 2013-09-04 05:17 Step-BY-Step 阅读(223) 评论(0) 推荐(0) 编辑

减肥时需注意

摘要: 一、多选择全麦食物 吃惯了精细米面,那么正好趁着要减肥就多选择全麦食物吧,它们能让你不饿肚子就瘦。全麦食物有很多种类,比如糙米、燕麦等,全麦食物由于加工程序比较少,含有的额外的热量就没有精细米面那么多了,所以可以多选择,但一定要看准百分百全麦的。 二、多吃新鲜水果 不需要减肥的时候也是需要每天都吃水果,但减肥期间不妨多增加一点分量。新鲜水果中含有大量的水分,能有较强的饱足感,而所含的高纤维则能帮助润肠,有通便的功能,能起到有效的排毒减肥之功效,所以减肥的时候,每天不妨多吃一些水果。 三、多吃点蔬菜 蔬菜和水果一样都含有丰富的纤维质和营养成分,所以在减肥的时候,除了多吃新鲜水果外还要多... 阅读全文

posted @ 2013-09-04 05:15 Step-BY-Step 阅读(137) 评论(0) 推荐(0) 编辑

喝茶要看体质“下单” 否则极易伤身

摘要: 夏天,茶是人们喜欢的饮品,不过医学专家提醒:喝茶需辨清体质,适当饮用,否则极易伤身。中医认为人的体质有燥热、虚寒之别,而茶叶经过不同的制作工艺也有凉性及温性之分,所以体质各异饮茶也有讲究。燥热体质的人,应喝凉性茶,虚寒体质者,应喝温性茶。常见的茶叶主要分为绿茶、清茶(包括乌龙茶、铁观音、大红袍)、红茶、黑茶(普洱茶)等几大类。这基本上是根据茶叶发酵程度由低至高划分的。一般而言,绿茶和清茶中的铁观音由于发酵程度较低,属于凉性的茶;清茶中的乌龙茶、大红袍属于中性茶,而红茶、普洱茶属于温性茶。专家建议,有抽烟喝酒习惯,容易上火、热气及体形较胖的人(即燥热体质者)喝凉性茶;肠胃虚寒,平时吃点苦瓜、西瓜 阅读全文

posted @ 2013-09-04 05:13 Step-BY-Step 阅读(305) 评论(0) 推荐(0) 编辑

2013年8月8日

What is SuppressWarnings (“unchecked”) in Java?

摘要: ometime when looking through code, I see many methods specify an annotation:@SuppressWarnings("unchecked")Sometimes Java generics just doesn't let you do what you want to, and you need to effectively tell the compiler that what you're doing reallywillbe legal at execution time.I us 阅读全文

posted @ 2013-08-08 02:25 Step-BY-Step 阅读(275) 评论(0) 推荐(0) 编辑

2013年8月1日

install Nagios on Unbuntu Unix

摘要: Ubuntu QuickstartUp To:ContentsSee Also:Quickstart Installation Guides,Security ConsiderationsIntroductionThis guide is intended to provide you with simple instructions on how to install Nagios from source (code) on Ubuntu and have it monitoring your local machine inside of 20 minutes. No advanced i 阅读全文

posted @ 2013-08-01 06:38 Step-BY-Step 阅读(193) 评论(0) 推荐(0) 编辑

Nagios3完整配置文档

摘要: 第一章:简单快速安装nagios1.1 准备软件包在做安装之前确认要对该机器拥有root权限。 确认你安装好的linux系统上已经安装如下软件包再继续。ApacheGCC编译器GD库与开发库Openssl-devel可以用yum命令来安装这些软件包,键入命令:yum –y install httpd gcc glibc glibc-common gd gd-devel1.2 操作过程1.2.1 建立nagios账号/usr/sbin/useradd nagios && passwd nagios创建一个用户组名为nagcmd用于从Web接口执行外部命令。将nagios用户和ap 阅读全文

posted @ 2013-08-01 06:35 Step-BY-Step 阅读(327) 评论(0) 推荐(0) 编辑

CentOS 5: Make Command not Found

摘要: 在centos 5下安装软件遇到的问题,google了一圈,是因为系统没有安装编译器,那安装就是了,嘿嘿。解决办法,在SSH下输入下面的命令yum -y install gcc automake autoconf libtool make 阅读全文

posted @ 2013-08-01 05:20 Step-BY-Step 阅读(261) 评论(0) 推荐(0) 编辑

linux yum命令详解

摘要: yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器。基於RPM包管理,能够从指定的服务器自动下载RPM包并且安装,可以自动处理依赖性关系,并且一次安装所有依赖的软体包,无须繁琐地一次次下载、安装。yum提供了查找、安装、删除某一个、一组甚至全部软件包的命令,而且命令简洁而又好记。yum的命令形式一般是如下:yum [options] [command] [package ...]其中的[options]是可选的,选项包括-h(帮助),-y(当安装过程提示选择全部为"yes") 阅读全文

posted @ 2013-08-01 05:09 Step-BY-Step 阅读(243) 评论(0) 推荐(0) 编辑

2013年7月30日

Data transfer object

摘要: Data transfer object(DTO)is adesign patternused to transfer data betweensoftware applicationsubsystems. DTOs are often used in conjunction withdata access objectsto retrieve data from adatabase.The difference between data transfer objects andbusiness objectsordata access objectsis that a DTO does no 阅读全文

posted @ 2013-07-30 07:52 Step-BY-Step 阅读(184) 评论(0) 推荐(0) 编辑

2013年7月27日

A JSTL primer, Part 2: Getting down to the core

摘要: In theinitial articleof this series, you got your first look at JSTL. We described the use of itsexpression language(EL) to access data and operate on it. As you learned, the EL is used to assign dynamic values to the attributes of JSTL custom tags, and thus plays the same role as JSP expressions fo 阅读全文

posted @ 2013-07-27 02:32 Step-BY-Step 阅读(273) 评论(0) 推荐(0) 编辑

2013年7月23日

正则表达式30分钟入门教程

摘要: 版本:v2.33 (2013-1-10) 作者:deerchao转载请注明来源目录跳过目录本文目标如何使用本教程正则表达式到底是什么东西?入门测试正则表达式元字符字符转义重复字符类分枝条件反义分组后向引用零宽断言负向零宽断言注释贪婪与懒惰处理选项平衡组/递归匹配还有些什么东西没提到联系作者网上的资源及本文参考文献更新纪录本文目标30分钟内让你明白正则表达式是什么,并对它有一些基本的了解,让你可以在自己的程序或网页里使用它。如何使用本教程最重要的是——请给我30分钟,如果你没有使用正则表达式的经验,请不要试图在30秒内入门——除非你是超人 :)别被下面那些复杂的表达式吓倒,只要跟着我一步一步来, 阅读全文

posted @ 2013-07-23 06:33 Step-BY-Step 阅读(220) 评论(0) 推荐(0) 编辑

Pie Charts

摘要: Default pie chartThe default pie chart with no options set.Source Code$.plot('#placeholder', data, { series: { pie: { show: true } }});Pie Optionsoption:default value- Description of optionshow:false- Enable the plugin and draw as a pie.radius:'auto'- Sets the radius o... 阅读全文

posted @ 2013-07-23 05:46 Step-BY-Step 阅读(453) 评论(0) 推荐(0) 编辑

2013年7月17日

spring <form:checkboxes> tag and css class

摘要: I have issue with:If previous line is used in jsp, then generated html looks like:ROLE_NEWUSERROLE_USERROLE_EDITORROLE_ADMINISTRATORPlease notice that css class is added to input tag. Instead css class is added to input tag I need this class to be added to span tag. Is there any solution to my probl 阅读全文

posted @ 2013-07-17 09:53 Step-BY-Step 阅读(577) 评论(0) 推荐(0) 编辑

how to make form:checkboxes in JSP

摘要: retransmitTable.jsp file: retransmit_style.css file:fieldset { border: 0; padding-bottom: 9px; }label .radios {padding-top: 18px; background: url(divider.png) repeat-x 0 0; }.label_check1{display: block; cursor: pointer; line-height: 20px; padding-... 阅读全文

posted @ 2013-07-17 09:51 Step-BY-Step 阅读(296) 评论(0) 推荐(0) 编辑

Spring MVC Checkbox And Checkboxes Example

摘要: In Spring MVC,is used to render a HTML checkbox field, the checkbox values are hard-coded inside the JSP page; While theis used to render multiple checkboxes, the checkbox values are generated at runtime.In this tutorial, we show you 3 different ways of render HTML checkbox fields:1. – Single Check. 阅读全文

posted @ 2013-07-17 02:25 Step-BY-Step 阅读(1307) 评论(0) 推荐(0) 编辑

2013年7月13日

Making your local server accessible from anywhere

摘要: In reality you probably don’t want to host you websites on your local computer unless you have a very good computer, a very good internet connection and you are an expert system administrator, but this is very useful to learn how the internet works.In this case I am doing this because I want to be a 阅读全文

posted @ 2013-07-13 05:07 Step-BY-Step 阅读(254) 评论(0) 推荐(0) 编辑

linux telnet命令参数及用法详解--telnet连接远程终端命令

摘要: 功能说明:远端登入。语 法:telnet [-8acdEfFKLrx][-b别名>][-e][-k][-l][-n][-S][-X][主机名称或IP地址]补充说明:执行telnet指令开启终端机阶段作业,并登入远端主机。参 数: -8 允许使用8位字符资料,包括输入与输出。 -a 尝试自动登入远端系统。 -b 使用别名指定远端主机名称。 -c 不读取用户专属目录里的.telnetrc文件。 -d 启动排错模式。 -e 设置脱离字符。 -E 滤除脱离字符。 -f 此参数的效果和指定"-F"参数相同。 -F 使用Kerberos V5认证时... 阅读全文

posted @ 2013-07-13 04:15 Step-BY-Step 阅读(997) 评论(0) 推荐(0) 编辑

Maven的Dependency怎么找?

摘要: 用了Maven,所需的JAR包就不能再像往常一样,自己找到并下载下来,用IDE导进去就完事了,Maven用了一个项目依赖(Dependency)的概念,用俗话说,就是我的项目需要用你这个jar包,就称之为我的项目依赖你这个包,换句话说,你这个JAR包就是我这个项目的Dependency。于是很多人在刚用Maven的时候,就会在加Dependency时栽跟头,明明我手头上就有需要的JAR嘛,它偏不让我用,什么道理,跟着就是生闷气,少点耐性的,就会说Maven怎么怎么不爽,其实,如果你理解了Maven的一些机制,一些配置及管理的流程,就会觉得它其实很爽。我暂且不谈Maven的长篇概念(其实我也还很 阅读全文

posted @ 2013-07-13 03:43 Step-BY-Step 阅读(841) 评论(0) 推荐(0) 编辑

2013年7月12日

Maven SDK

摘要: Maven SDKDetailsPrintTags:developmentmavenmaven2liferay v6.0Table of Contents[-]IntroductionInstalling a maven proxy / repositoryConfiguring Maven SettingsInstalling Liferay Artifacts to RepositoryInstalling the Liferay Maven SDKCreating a Portlet PluginFuture PlansIntroduction#Latest efforts relati 阅读全文

posted @ 2013-07-12 05:41 Step-BY-Step 阅读(434) 评论(0) 推荐(0) 编辑

Generating Huge reports in JasperReports

摘要: There are certain things to care while implementing the Jasper Reports for huge dataset to handle the memory efficiently, so that the appliacation does not go out of memory.They are:1) Pagination of the data and use of JRDataSource,2) Viruatization of the report.When there is a huge dataset, it is n 阅读全文

posted @ 2013-07-12 03:39 Step-BY-Step 阅读(733) 评论(0) 推荐(0) 编辑

2013年7月10日

Stretch a row if data overflows in jasper reports

摘要: My band stretches if necessary with the following conditions, I do not know yours. I have started with the ireport 1.0 netbeans plug-in and jasper 3.5.2. The Split type for the band has been set to Stretch.The Stretch with overflow for the field has been checked, e.g.: 阅读全文

posted @ 2013-07-10 05:52 Step-BY-Step 阅读(374) 评论(0) 推荐(0) 编辑

2013年7月6日

Eclipse 插件开发 —— 深入理解查找(Search)功能及其扩展点

摘要: 引言查找功能是计算机语言开发环境 / 平台的一个非常重要的特性。Eclipse 也不例外,它提供了丰富的查找功能(用户可以输入正则表达式或任意字符串,指定查找范围和匹配选项等等),并且提供了简单易用的接口方便开发人员扩展。Eclipse 的查找功能是基于 MVC 设计模式架构的,因此如果读者先前对 MVC 模式了解的话,有助于读者理解 Eclipse 的查找框架。在 Eclipse 的开发平台中,通过快捷键 CTRL+H 或者 Search 菜单可以激活其查找功能,如图 1 为 Eclipse3.4 插件开发版本按下快捷键时弹出的查找对话框(Search Dialog)。图 1. Eclips 阅读全文

posted @ 2013-07-06 04:40 Step-BY-Step 阅读(1437) 评论(0) 推荐(0) 编辑

2013年7月3日

Spring Auto Scanning Components

摘要: Normally you declare all the beans or components in XML bean configuration file, so that Spring container can detect and register your beans or components. Actually, Spring is able to auto scan, detect and instantiate your beans from pre-defined project package, no more tedious beans declaration in 阅读全文

posted @ 2013-07-03 00:29 Step-BY-Step 阅读(316) 评论(0) 推荐(0) 编辑

SSH架构简单总结

摘要: Struts、spring、Hibernate在各层的作用1)struts 负责 web层. ActionFormBean 接收网页中表单提交的数据,然后通过Action 进行处理,再Forward到对应的网页。 在struts-config.xml中定义, ActionServlet会加载。2)spring 负责业务层管理,即Service(或Manager).1. service为action提供统计的调用接口,封装持久层的DAO,。2.可以写一些自己的业务方法。3.统一的javabean管理方法4.声明式事务管理5.集成Hiberante3)Hiberante,负责持久化层,完成数据库的 阅读全文

posted @ 2013-07-03 00:26 Step-BY-Step 阅读(287) 评论(0) 推荐(0) 编辑

2013年7月2日

eclipse进行开发

摘要: 最近在用eclipse进行开发的时候遇到了一个很奇怪的问题,其实这个问题很早以前就遇到了只是苦于一直没有需找到答案。直到今天又遇到了,才觉得这真是个很实用很使用的功能,所以分享给大家,希望对大家有帮助。问题是这样的:在eclipse中我想查找某个文件中用到了xxxservice,于是我search-file-然后找到了搜索结果(我们称“第一个文件”),我在搜索结果中双击搜索的文件打开查看。当我利用同样的搜索功能搜索到另一个文件(我们称“第二个文件”),当双击“第二个文件”打开查看后又想看“第一个文件”时却发现第一个文件不见了(打开的文件列表里面没有“第一个文件”了)。也就是说默认通过searc 阅读全文

posted @ 2013-07-02 09:29 Step-BY-Step 阅读(174) 评论(0) 推荐(0) 编辑

jasper ireport create a report with parameters without sql query

摘要: I'm new in jasper ireport , and I want to know if it is possible to create a report only with static text and parameters, but without any sql query.When I design my report it is possible , but when I try to preview it , I get this message: "The document has no pages" .I want my java pr 阅读全文

posted @ 2013-07-02 08:10 Step-BY-Step 阅读(265) 评论(0) 推荐(0) 编辑

2013年7月1日

VARCHAR2转换为CLOB碰到ORA-22858错误

摘要: 近日工作中发现有一张表的字段类型建错了,本应是BLOB类型却被别人建成了VARCHAR2(200),修改时oracle却提示“ORA-22858 invalid alteration of datatype”错误。经查看相关资料才了解,是oracle不允某些类型的字段修改。具体就是不可以将字段类型修改为:object、REF、nested table、VARRAY、 CLOB、BLOB。解决方案也很简单就是像学数据结构时经常用到的两变量(a,b)交换值的方法,c = a, a = b, b = c。当然我们这里可以简单处理,具体方法如下:1、将字段a改名为_a2、新建一个字段a,用正确的类型3 阅读全文

posted @ 2013-07-01 13:32 Step-BY-Step 阅读(468) 评论(0) 推荐(0) 编辑

2013年6月28日

cannot find w3wp.exe in VS

摘要: Same thing was happening to me, when i remembered that IIS has an idle timeout! As above the proc w3wp is running, but VS2010 looks at it in the sleep state and thinks its not running, so dos'nt show it in the list...spinning up IIS [calling a site served from locahost in your favourite web brow 阅读全文

posted @ 2013-06-28 23:49 Step-BY-Step 阅读(183) 评论(0) 推荐(0) 编辑

10 things you should know about NoSQL databases

摘要: For a quarter of a century, the relational database (RDBMS) has been the dominant model for database management. But, today, non-relational, “cloud,” or “NoSQL” databases are gaining mindshare as an alternative model for database management. In this article, we’ll look at the 10 key aspects of these 阅读全文

posted @ 2013-06-28 07:20 Step-BY-Step 阅读(173) 评论(0) 推荐(0) 编辑

Notifications Nagios

摘要: IntroductionI've had a lot of questions as to exactly how notifications work. This will attempt to explain exactly when and how host and service notifications are sent out, as well as who receives them.Notification escalations are explainedhere.When Do Notifications Occur?The decision to send ou 阅读全文

posted @ 2013-06-28 00:46 Step-BY-Step 阅读(528) 评论(0) 推荐(0) 编辑

2013年6月27日

Serializable

摘要: 转自http://blog.csdn.net/cdl2008sky/article/details/6747396Serizlizable 作用对于一个存在于Java虚拟机中的对象来说,其内部的状态只保持在内存中。JVM停止之后,这些状态就丢失了。在很多情况下,对象的内部状态是需要被持久化下来的。提到持久化,最直接的做法是保存到文件系统或是数据库之中。比如:对象关系映射(Object-relational mapping)。对象序列化机制(object serialization)是Java语言内建的一种对象持久化方式,可以很容易的在JVM中的活动对象和字节数组(流)之间进行转换。除了可以很简 阅读全文

posted @ 2013-06-27 09:09 Step-BY-Step 阅读(550) 评论(0) 推荐(0) 编辑

Interface Serializable

摘要: public interface SerializableSerializability of a class is enabled by the class implementing the java.io.Serializable interface. Classes that do not implement this interface will not have any of their state serialized or deserialized. All subtypes of a serializable class are themselves serializable. 阅读全文

posted @ 2013-06-27 09:02 Step-BY-Step 阅读(418) 评论(0) 推荐(0) 编辑

ICMP and InetAddress.isReachable()

摘要: In Java it is only possible to work with two types of sockets: stream based ones (or TCP ones -java.net.Socketandjava.net.ServerSocket) and datagram based ones (or UDP ones -java.net.DatagramSocketandjava.net.MulticastSocket).The open bug4727550asks to support other socket types, that will allow, fo 阅读全文

posted @ 2013-06-27 06:33 Step-BY-Step 阅读(772) 评论(0) 推荐(0) 编辑

Java 程序检查远程服务器状态

摘要: 通常我们以命令的方式判断远程服务器是否正常运行有两种方式,ping或telnet一个远程端口。假设我们要检查的远程服务器都是 Linux 系统。从 JDK 1.5 以后,InetAddress类提供一个isReachable()方法,用来判断远程主机是否可以到达,这个方法的使用的时候一定要注意以下几点:如果客户端是 Windows 系统,JDK不会向服务器发送ICMP的请求,因为 Windows 没有提供可被调用的底层接口,这时 JDK 会自动向服务器的Port 7发起一个 Socket 连接,如果连接也失败,则认为服务器无法到达,返回False。 注意在客户端执行此程序无须管理员用户,但要求 阅读全文

posted @ 2013-06-27 06:19 Step-BY-Step 阅读(3007) 评论(0) 推荐(0) 编辑

上一页 1 ··· 7 8 9 10 11 12 13 14 下一页

导航