卖出的票为负数的情况: class MyThread22 implements Runnable { private int ticket = 10; public void run() { for (int i = 0; i 0) { try { Thread.sle...
分类:
编程语言 时间:
2014-08-06 21:48:12
阅读次数:
236
public Test() throws RepletException { try { System.out.println("Test this Project!") } catch (Exception e) { throw new Exception(e...
分类:
其他好文 时间:
2014-08-06 21:46:32
阅读次数:
196
public int importExcel(String path,int type){ if(mark==false){ return 0; }else try{ POIFSFileSystem fs; ...
分类:
其他好文 时间:
2014-08-06 18:28:41
阅读次数:
198
1 package com.intel.aug6; 2 3 import java.util.InputMismatchException; 4 import java.util.Scanner; 5 6 public class TestException2 { 7 8 publi...
分类:
编程语言 时间:
2014-08-06 14:30:11
阅读次数:
242
在程序中允许一个线程进行暂时的休眠,直接使用Thread.sleep()方法即可实现休眠: class myThread11 implements Runnable { public void run() { for (int i = 0; i < 5; i++) { try { Thread......
分类:
编程语言 时间:
2014-08-06 11:42:31
阅读次数:
257
1.try 永远不会抛出异常 在 没有的时候 返回 nil
province_id = Province.find_by_name(prov).try(:id)
2.find(:first, :condotions) 方法 不言而与
mobile_info = MobileInfo.find(:first, :conditions => ["mobile_num = ? ", mobi...
分类:
其他好文 时间:
2014-08-06 10:32:31
阅读次数:
304
configure: error: Try adding --with-zlib-dir=. Please check config.log for more information.----------------------------------------------------------...
分类:
Web程序 时间:
2014-08-06 01:22:41
阅读次数:
274
Q:在安装setuptools时Python ez_setup.py,或者安装其他egg包,有时候会碰到: UnicodeDecodeError错误,这是为什么呢?
安装setuptools时UnicodeDecodeError错误
mimetypes.init() # try to read system mime.types
File "C:\Python27\lib\mim...
分类:
其他好文 时间:
2014-08-05 19:35:50
阅读次数:
201
tail-f/var/log/neutron/dhcp-agent.logBydefault,CentOS6.4doesnotsupportnetworknamespaces.Ifonewantstotestthenewvirtualizationplatforms(Docker,OpenStack,&co…)onaCentOSserver,allfeatureswon’tbeavailable.ForOpenStackforexample,Neutronwon’tworkasexpected,..
分类:
Web程序 时间:
2014-08-05 11:35:39
阅读次数:
1996
import threading
def tryfinally(finallyf):
u"returns a decorator that adds try/finally behavior with given no-argument call in the finally"
print "tryfinally"
def decorator(callable):
p...
分类:
编程语言 时间:
2014-08-05 11:17:29
阅读次数:
226