This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Aug 31, 2011 7:30:17 PM org.apache.catalina.startup.Embedded initDirs | |
SEVERE: Cannot find specified temporary folder at /home/lifu/projects/apache-tomcat-6.0.32/temp | |
Aug 31, 2011 7:30:17 PM org.apache.catalina.core.AprLifecycleListener init | |
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /home/a/project/java/jre/lib/amd64/server:/home/a/project/java/jre/lib/amd64:/home/a/project/java/jre/../lib/amd64:/usr/java/packages/lib/amd64:/lib:/usr/lib | |
Aug 31, 2011 7:30:18 PM org.apache.coyote.http11.Http11Protocol init | |
INFO: Initializing Coyote HTTP/1.1 on http-9999 | |
Aug 31, 2011 7:30:18 PM org.apache.catalina.startup.Catalina load | |
INFO: Initialization processed in 747 ms | |
Aug 31, 2011 7:30:18 PM org.apache.catalina.core.StandardService start | |
INFO: Starting service Catalina |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ 3420.375053] sd 7:0:0:0: [sdb] Attached SCSI removable disk | |
[ 3451.160068] usb 1-8: reset high speed USB device using ehci_hcd and address 11 | |
[ 3482.200129] usb 1-8: reset high speed USB device using ehci_hcd and address 11 | |
[ 3513.160142] usb 1-8: reset high speed USB device using ehci_hcd and address 11 | |
[ 3544.200062] usb 1-8: reset high speed USB device using ehci_hcd and address 11 | |
[ 3575.160058] usb 1-8: reset high speed USB device using ehci_hcd and address 11 | |
[ 3600.550125] INFO: task udisks-daemon:1957 blocked for more than 120 seconds. | |
[ 3600.550130] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. | |
[ 3600.550133] udisks-daemon D 0000000000000001 0 1957 1956 0x00000000 | |
[ 3600.550138] ffff8800b30b7958 0000000000000082 ffff8800b30b7fd8 ffff8800b30b6000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fiber' | |
x = nil | |
f1 = nil | |
f1 = Fiber.new do |f| | |
1000.times do | |
p 'f1' | |
sleep 0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def f(i); puts('%10s' % i) if i%1000==0; Fiber.new{f(i+1)}.resume end; f(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while(s=gets) | |
a = s.split(' ') | |
puts IO.foreach('input.txt'){|line| | |
array = line.split(' '); | |
# 下面的判断若通过,则a的成员都在array中,可以直接返回 | |
break array[0] if( (array - a).size == array.size - a.size) | |
} | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
王 | |
江 | |
周 | |
胡 | |
刘 | |
李 | |
吴 | |
毛 | |
温 | |
习 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def prime n | |
list = (2..n).to_a | |
(2...(n ** (0.5)).floor).each do |i| | |
list.delete_if{|e| e > i && e % i == 0} | |
end | |
list | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require './prime.rb' # user defined function | |
require 'benchmark' | |
require 'digest/md5' | |
result = { | |
4 => 'ae5161e4645f5cd58897d32f529f3ad5', | |
5 => 'cf7b5007830f057a04d2b696527952e7', | |
6 => 'a43beaed59a26b8d85868eaa8fa2e972', | |
7 => 'c1aa9bda24aa8bc5473ca1f51c9fd106' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'thread' | |
def prime n, concurrent_num=4 | |
full_list = (2..n).to_a | |
prime_list = [] | |
stop_index = (n ** 0.5).floor | |
last_prime = 2 | |
while(last_prime < stop_index) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MyTool | |
module Tree | |
class << self | |
def loop root, &block | |
return false unless File.exist? root | |
block_given? ? exec(root, &block) : collect(root) | |
end | |
def exec root, &block |
OlderNewer