query oracle cursor sql
select sid, count(sid) cc from v$open_cursor where user_name='USER' group by sid order by cc desc; select * from v$open_cursor where user_name='USER' and sid=1043;
select sid, count(sid) cc from v$open_cursor where user_name='USER' group by sid order by cc desc; select * from v$open_cursor where user_name='USER' and sid=1043;
1. Install Homebrew2. Install Git and sqlite /usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"3. Install RVM brew install git sqlite4. Install Ruby and Rails bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)http://railscasts.com/episodes/310-getting-started-with-rails?view=asciicast Notice: Xcode Version 4.2.x for OS X Lion works only for ruby 1.9.3-p0 (or higher) rvm install 1.9.3 --with-gcc=clang rvm use 1.9.3 --default gem install rails
1) Install PostgreSQL2) Init Database brew install postgresql3) Run/Stop Database initdb /usr/local/var/postgres4) Create a Database pg_ctl -D /usr/local/var/postgres Or pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start & Start manually with: pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start And stop with: pg_ctl -D /usr/local/var/postgres stop -s -m fast5) Open the mydb database createdb mydb psql mydb
rails truncate方法把一个中文作为和英文相同的长度来截取,使用同样的length参数,会导致截取的英文字符串比中文字符串在视觉上短很多, truncate_u方法是把一个中文大约视为2个英文的宽度转载自http://www.iteye.com/topic/201531 def truncate_u(text, length = 30, truncate_string = "...") l=0 char_array=text.unpack("U*") char_array.each_with_index do |c,i| l = l+ (c<127 ? 0.5 : 1) if l>=length return char_array[0..i].pack("U*")+(i1 ? truncate_string : "") end end return text end truncate_u("english string", 2) # 截取2个中文字宽,所以是返回4个英文加上"..." # => engl... truncate_u("中文字符串", 2) # => 中文... truncate_u("中文 and english", 6) # 截取6个中文字宽,所以是返回2个中文,8个ascii字符,以及truncate_string # => 中文 and eng ... truncate_u("中文 and english", 8) # 完整截取,返回和输入一致的字符串 # => 中文 and english
拼音笔划 SELECT * FROM TEAM ORDER BY NLSSORT(排序字段,'NLS_SORT = SCHINESE_PINYIN_M')部首 SELECT * FROM TEAM ORDER BY NLSSORT(排序字段,'NLS_SORT = SCHINESE_STROKE_M')转载自 http://zhuguo-guo.iteye.com/blog/1153335 SELECT * FROM TEAM ORDER BY NLSSORT(排序字段,'NLS_SORT = SCHINESE_RADICAL_M')
在/etc/profile或其它配置文件加上如下内容: export NLS_LANG="SIMPLIFIED CHINESE_CHINA.UTF8"(or NLS_LANG=AMERICAN_AMERICA.UTF8)
just add following line to file ~/.gemrc gem: --no-rdoc --no-ri
install ruby 1.9.2 have compiles 32 bit error to resolve it, before installing the ruby add following line to file ~/.rvmrcinstall ruby 1.8.7 or ree have readline error rvm_archflags="-arch x86_64" rvm package install readline rvm install 1.8.7(or ree) -C --with-readline-dir=$rvm_path/usr OR ruby extconf.rb --with-readline-dir=$rvm_path/usr make clean make rvm install 1.8.7(or ree) -C --with-readline-dir=$rvm_path/usr
select id, count(*) from users group by id having count(*) > 1
产品和业务模式,市场和运营策略,用户体验和界面设计都必须围绕着用户进行,且三者缺一不可,必须融为一体.产品设计是一份综合性工作,只做好任何一块都不会成变好的产品. 互联网的竞争:粗放型综合化竞 > 精细型分庭抗拒 > 开放,协作,分享. 得入口者得天下 > 得平台者得天下 > 得用户者得天下. 产品设计所有的过程必须都把用户放在第一位.