码迷,mamicode.com
首页 >  
搜索关键字:try    ( 12995个结果
线程的资源同步问题
卖出的票为负数的情况: 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
throw和throws的区别
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
读取excel文件
public int importExcel(String path,int type){ if(mark==false){ return 0; }else try{ POIFSFileSystem fs; ...
分类:其他好文   时间:2014-08-06 18:28:41    阅读次数:198
Java 异常之 try catch finally--除数不为0
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
Ruby 零碎点
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
linux安装php出现的各种错误解决方案
configure: error: Try adding --with-zlib-dir=. Please check config.log for more information.----------------------------------------------------------...
分类:Web程序   时间:2014-08-06 01:22:41    阅读次数:274
setuptools " UnicodeDecodeError:"问题探究
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
“Object "netns" is unknown, try "ip help".\n'”报错
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
python装饰器实现线程同步
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!