`
文章列表
下面是stackoverflow中关于数组方法的相关问题中,获得最多票数的12个数组操作方法。 1.  声明一个数组 Java代码 复制代码 1.String[] aArray = new String[5];  2.String[] bArray = {"a","b","c", "d", "e"};  3.String[] cArray = new String[]{"a","b","c","d", ...
Shell中while循环的done 后接一个重定向< means that the While读文件的方法: 第一步: 将文件的内容通过管道(|)或重定向(<)的方式传给while 第二步: while中调用read将文件内容一行一行的读出来,并付值给read后跟随的变量。变量中就保存了当前行中的内容。 例如读取文件/sites/linuxpig.com.txt 1)管道的方式: cat /sites/linuxpig.com.txt |while read LINE do echo $LINE ...
1、获得时间差毫秒数: select ceil((To_date('2008-05-02 00:00:00' , 'yyyy-mm-dd hh24-mi-ss') - To_date('2008-04-30 23:59:59' , 'yyyy-mm-dd hh24-mi-ss')) * 24 * 60 * 60 * 1000) 相差豪秒数 FROM DUAL; 相差豪秒数 ---------- 86401000 2、获得相差秒数: select ceil((To_date('2008-05-02 00:00:00' , 'yyyy-mm-dd hh24-mi-ss ...
decode是pl/sql语法,只能在oracle中使用, case when是标准SQL的语法,哪儿都能用,也就是说移植性更强. decode像是case when的精简版, DECODE只能用做相等判断,但是可以配合sign函数进行大于,小于,等于的判断;CASE可用于=,>=,<,<=,<>,is null,is not null 等的判断; 当要实现的功能比较简单时,用decode方便,简洁. decode(条件,值1,返回值1,值2,返回值2,...值n,返回值n,缺省值) 该函数的含义如下: IF 条件=值1 THEN     RETURN ...
http://stackoverflow.com/questions/23071771/how-to-create-a-slow-sql-query http://www.oraclerecipes.com/monitoring/monitor-long-running-oracle-operations/ https://community.oracle.com/thread/905506?customTheme=otn
Logger来自log4j自己的包。如果用Logger.getLogger,需要一个log4j的jar包. LogFactory来自common-logging包。如果用LogFactory.getLog,你可以用任何实现了通用日志接口的日志记录器替换log4j,而程序不受影响。apache的common-logging包是通用日志接口,通过这个中间层,你可以随便指定到底用哪个日志系统。增加系统的灵活性。若log4j它不存在, commons-logging 会另行选择其它的日志实现类。 这样保证了程序中不一定要使用log4j这个日志文件了 增强灵活性的理由: 1)首先在 classpat ...
ssh 无密码登录要使用公钥与私钥。linux下可以用用ssh-keygen生成公钥/私钥对。 有机器A(192.168.1.100),B(192.168.1.151)。现想A通过ssh免密码登录到B。 1.在A机下生成公钥/私钥对,使用ssh-keygen生成一对密钥,存放在用户目录的~/.ssh下 ...
Log4j pattern format explain: %m 输出代码中指定的消息 %p 输出优先级,即DEBUG,INFO,WARN,ERROR,FATAL %r 输出自应用启动到输出该log信息耗费的毫秒数 %c 输出所属的类目,通常就是所在类的全名 %t 输出产生该日志事件的线程名 %n 输出一个回车换行符,Windows平台为“rn”,Unix平台为“n” %d 输出日志时间点的日期或时间,默认格式为ISO8601,也可以在其后指定格式,比如:%d{yyyy MMM dd HH:mm:ss,SSS},输出类似:2002年10月1 ...
@echo off setlocal enableextensions setlocal enabledelayedexpansion for /f "tokens=1 delims= " %%m in (sys.out) do ( set num=%%m if /i !num! equ 5 ( echo 1 >nsys.out del sys.out && move nsys.out sys.out ) else ( set old=%%m set /a newN=!old!+1 ...
1: who 命令查看 who -b 查看最后一次系统启动的时间。 who -r 查看当前系统运行时间 [root@Server ~]# who -b system boot May 11 09:27 2: last reboot [root@Server ~]# last reboot reboot system boot 2.6.9-42.ELsmp Thu May 29 15:25 (00:07) reboot system boot 2.6.9-42.ELsmp Sun May 11 09: ...
echo "2013abcd07" | sed 's/^\(.\{8\}\)/\1-/' output: 2013abcd-07 it will insert character '-' after 8 characters time=125959 ## expected : 12:59:59 echo ${time:0:2}:${time:2:2}:${time:4:2} Example: input: "abcd" output: ".abcd a.bcd ab.cd abc.d abc ...
For reference only. If you've ever gotten a phone call from an annoyed user whose transaction just won't go through, or from a developer who can't understand why her application sessions are blocking each other, you know how useful it can be to identify not just whose lock is doing the blocking, but ...
一、运算符 算术运算符:+ - * / 可以在select 语句中使用 除法: select MOD(65,50) from dual --取余 select trunc( 65/33) from dual -- 取整 trunc (1.9) = 1 select ceil(65/60) from dual -- 取整 ceil(1.1) = 2 Select cast(100*1.0/101 as decimal(18, 2)) -- 0.99 连接运算符:|| select deptno|| dname from dept ...
stat -c %y filename | awk '{print $1 $2 $3}' | cut -d "." -f1 | sed -e 's/-//g' -e 's/://g' stat filename | grep Modify | awk '{print $2 $3}' | cut -d "." -f1 | sed -e 's/-//g' -e 's/://g' stat filename | grep Modify | awk '{print $2}' 比系统时间早3min, a=`stat -c %Y filename ...
打包:把多个文件变成一个文件,常用tar。      # tar -cf all.tar *.jpg   这条命令是将所有.jpg的文件打成一个名为all.tar的包。 -c是表示产生新的包, -f指定包的文件名。   # tar -rf all.tar *.gif   这条命令是将 ...
Global site tag (gtag.js) - Google Analytics