- 浏览: 89768 次
最新评论
文章列表
指定用户允许使用的节点:
参考 http://rockscluster.5d6d.net/thread-76-1-1.html
例如root用户只能使用compute-2, compute-0-3, compute-0-4的节点:
对已存在的队列,作如下设置:
set queue batch queue_type = Executionset queue batch resources_default.neednodes = platformf5 F$ E* q/ s, n5 Hset queue batch enabled = True
RedHat 是商业版本,如果没有在官网注册,使用 yum 将会提示
This system is not registered with RHN
而不能在线安装。要启用 yum, 本文采取的办法是卸载原有的 yum,安装相应的 CentOS 版本的 yum。这个方法有很大的风险,因为必须要找到对应系统版本的 yum 才能正确地安装。本文的系统是 RedHat EL 5.0 版本,但却要安装 CentOS 6 版本的 yum。
国内的 yum 源有如下几个:
163网站: http://mirrors.163.com
中科大网站:http://mirrors.ustc.ed ...
查看局域网内的计算机 ip:
首先,查看当前主机的 ip,使用 ifconfig 查看;然后使用 nmap 命令对局域网的计算机进行扫描,例如:
nmap 192.168.10.0/24
查看进程监听的端口号:
netstat -ntlp | grep pid
查看内核版本:
cat /proc/version
uname -a
查看linux版本
lsb_release -a
查看 cpu 信息:
cat /proc/cpuinfo
查看内存信息:
cat /proc/meminfo
更详细查看配置的命令:
http://www ...
从类的继承结构上看,Exception 和 Error 都继承与 java.lang.Throwable。
对于 Error ,API 的解释为:
An Error is a subclass of Throwable that indicates serious problems that a
reasonable application should not try to catch. Most such errors are abnormal
conditions. The ThreadDeath error, though a
"normal&quo ...
在腾讯的一问一答平台上遇到一道题:
int a = 6;
a += a -= a*a;
对于 C 语言,运行的结果 a 是 -60,符合右结合性;
对于 Java ,运行的结果却是 -24,却是左结合性。不太明白,求解……
首先要确定自己的操作系统版本,使用 lsb_release -a 命令查看,例如:
LSB Version: :core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 6.0 (Santiago)
Release: ...
代码段:
int main()
{
Graph * g = (Graph *)malloc(sizeof(Graph));
//createGraph(g);
g->numEdges = 15;
g->numVertexes = 9;
int i,j;
for (i=0; i<g->numVertexes; i++)
{
g->vexs[i] = i;
}
.....
将变量声明放在所有的语句之前,则可以编译通过。正确的代码段如下:
int main()
{
int i,j;
Gr ...
一个 session 对应于一个浏览器。今天舍友问起这个问题,提出了新的疑问,在 chrome 浏览器中新建新的窗口,而不是打开新的标签页,对于服务端来说,是否也是同一个 session 呢?
使用 chrome 浏览器,用不同的账号登录 163 邮箱之后,知道了答案。后登录的邮箱账号覆盖了先登录的邮箱账号。表现为,当对先登录的邮箱页面进行操作时,显示该账号登录超时。即便新建新的窗口,结果也是一样。
那么,是否与特定的浏览器有关?chrome 的特点之一是多页面多进程。使用 IE 浏览器做相同的测试之后,证明结果和 chrome 一致。
看来,只有使用不同的浏览器才能避免 se ...
程序如果长时间不进行数据库操作,那么数据源中的 Connection 很可能已经断开。其原因有可能是防火墙,或者连接的数据库设置的超时时间。这里使用的是 C3P0 连接 oracle 数据库,引起的异常信息为:
org.springframework.transaction.TransactionSystemException: Could not roll back Hibernate transaction; nested exception is org.hibernate.TransactionException: rollback failed
at org.spri ...
http://sandyxl001.blog.163.com/blog/static/166564102012729102013396/
在我的这篇博客中,有两种解决方法,一是使用 nvarchar2 类型来保存中文,二是进行手动转码。最近看到阿里巴巴也使用
了手动进行转码的方法来解决这个问题,使用了代理模式,将 oracle 的驱动包括在类里。
参考:http://alicsd.iteye.com/blog/891181
里面使用的 jar 包在附件中。
之所以要使用 c3p0 连接池,是因为 Hibernate 自带的 org.apache.commo ...
在 MyEclipse 中有两个工程:Platform 和 Fortest,后者是用来测试。Platform 已经加入 SVN,而 Fortest 并没有加
入。当在 User Libraries 中加入新的 jar 包时,Fortest 不能识别,报 ClassNotFound 异常,而 Platform 项目则正常识
别。
估计和 SVN 有关,暂时未找到原因。
在hibernate总配置文件里 加上
<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
这句就好了。
注: <property name="connection.characterEncoding">UTF-8</property> 光加这一句不行
http://www.linuxso.com/architecture ...
导致整个异常的原因可能是,当 Hibernate 和 Spring 整合时,在 Spring 中指定的 Hibernate.cfg.xml 文件内容中要注释掉以下内容:
<!-- Enable Hibernate's automatic session context management -->
<!-- <property name="current_session_context_class">thread</property> -->
这样,才能将 Hibernate 的 session ...
引用:http://wujuxiang.blog.51cto.com/2250829/409196
通过使用异或运算,可以快速将两个数的值交换:原理如下:我们知道异或是相同取0相反取1,如: 0101异或1101的结果是1000。如对两个数,经过三次进行异或运行后的结果是这两个数的值互换。如 a = 0101, b=1101,则进行的操作如下:第一次异或运算: a = a ^b = 1000第二次异或运算: b = a^b = 0101第三次异或运算: a = a^b = 1101至此,a和b这两个数的值已经互换了,并且没有使用到额外的储存空间。那么,能不能直接写一个函数直接将a和 ...
参考:http://www.blogjava.net/Nirvana/archive/2012/09/13/387618.html
在 JDK6.0 中集成的一款查看 Java 运行性能的监控软件,可以查看 Java 虚拟机的各种详细信息