运行到线程的时候已经进入死循环了,为什么还能调用事件监听的方法呢
可以这么理解吗 老师 字符串驻留机制 要判断2个条件 分别是 是否符合标识符规则 和 再编译时是否能确定值,两个都满足,就会驻留
在查询过程中遇到超时问题,可在web项目下的dubbo 配置文件里添加:
<dubbo:consumer timeout="30000"></dubbo:consumer>
设置超时时间从而解决
老师我安装了之后,出现下面的问题,不知道怎么解决,IE是11版本的,HTTPwatch是9.4的。
修改Linux网络配置文件ifcfg-etho为截图内容后ping 不通外网,然后重新vi ifcfg-etho提示产生了一个ifcfg-etho.swp。ping IPADDR是通的,但是 ping 114.114.114.114 网关不通
public class Test { public static void main(String[] args) { // File srcFile = new File("D:\\java10086\\test1.txt"); // File targetFile = new File("E:\\test1.txt"); // copyFile(srcFile, targetFile); File srcDir = new File("D\\java10086"); File targetDir = new File("E\\java10086"); copyDir(srcDir,targetDir); } public static void copyDir(File srcDir,File targetDir) { if (!targetDir.exists()) { targetDir.mkdir();//如果目的地的目录不存在,则需要使用File类方法进行创建目录 } File[] files = srcDir.listFiles();//获取指定目录下的所有File对象 for (File file : files) { if (file.isFile()) { copyFile(new File(srcDir+"\\"+file.getName()), new File(targetDir+"\\"+file.getName())); } else { copyFile(new File(srcDir+"\\"+file.getName()), new File(targetDir+"\\"+file.getName())); } } } public static void copyFile(File srcFile,File targetFile) { //(1)提高读写效率,从数据源 BufferedInputStream bis =null; //(2)提高写入效率,写到目的地 BufferedOutputStream bos = null; try { bis = new BufferedInputStream(new FileInputStream(srcFile)); bos = new BufferedOutputStream(new FileOutputStream(targetFile)); //(3)边读边写 byte [] buf = new byte[1024]; int len = 0; while ((len=bis.read(buf))!=-1) { bos.write(buf,0,len); } } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }finally { //(4)关闭 if (bos!=null) { try { bos.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } if (bis!=null) { try { bis.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } }
出现空指针异常的错误。不知道哪里错了?
class ComputerFactory: __obj = None __init_flag = True def __new__(cls, *args, **kwargs): if cls.__obj == None: cls.__obj == object.__new__(cls) return cls.__obj def creat_pc(self,brand): if brand == "联想": print("造了一个联想电脑") return Lianxiang() elif brand == "华硕": print("造了一个华硕电脑") return Huashuo() elif brand == "神州": print("造了一个神州电脑") return Shenzhou() else : return "请输入正确的电脑品牌" def __init__(self): if ComputerFactory.__init_flag: print("初始化代码执行了一次") ComputerFactory.__init_flag = False class Computer: def calcute(self): print("我是电脑父类的calcute方法...") class Huashuo(Computer): def calcute(self): print("我是华硕的calcute方法...") class Lianxiang(Computer): def calcute(self): print("我是联想的calcute方法...") class Shenzhou(Computer): def calcute(self): print("我是神州的calcute方法...") fac = ComputerFactory() lianxiang1 = fac.creat_pc("联想") lianxiang1.calcute()
老师 能帮忙看下这个错是怎么回事吗:
lianxiang1 = fac.creat_pc("联想")
AttributeError: 'NoneType' object has no attribute 'creat_pc'
麻烦老师帮我改个错误,实在不会,
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The method addWindowListener(WindowListener) in the type Window is not applicable for the arguments (new WindowAdapter(){})
WindowAdapter cannot be resolved to a type
WindowEvent cannot be resolved to a type
at cn.sxt.game.MyGameFrame.launchFrame(MyGameFrame.java:13)
at cn.sxt.game.MyGameFrame.main(MyGameFrame.java:23)
这个如果要求用降序排序应该把order by放哪,我试过下面两种都不行
为什么我的谷歌浏览器访问图片默认的是下载
老师,想问一下,我想把文字显示在图片上面应该怎么搞?
class FilterDeleteManager(models.Manager): def get_queryset(self): return super(FilterDeleteManager,self).get_queryset().filter(isdelete=False) def filter(self, *args, **kwargs): qs = self.get_queryset().filter(*args,**kwargs) qs.delete = types.MethodType(dele, qs) return qsdef dele(self,delobj): for i in delobj: i.isdelete = True i.save()
老师,上面filter方法里面的 qs.delete = types.MethodType(dele, qs) 不能直接写成
qs.delete = dele(qs)吗,必须要用MethodType来绑定吗
代码:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <script> function write(){ var span1=document.getElementById('span1') span1.innerText='123' } function read(){ var span1=document.getElementById('span1') alert(span1.value) } </script> </head> <body onload="write()"> <input type="button" id="but" onclick="read()" /> <span id="span1"></span> </body> </html>
运行结果:
问:为什么向span标签中写入的数据读不出来?
老师,启动服务器接收浏览器的信息报下面这个错,换成gbk,也没有解决。该如何解决啊?老师
服务器和HTML文件的代码如下:
非常抱歉给您带来不好的体验!为了更深入的了解您的学习情况以及遇到的问题,您可以直接拨打投诉热线:
我们将在第一时间处理好您的问题!
关于
课程分类
百战程序员微信公众号
百战程序员微信小程序
©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园网站维护:百战汇智(北京)科技有限公司 京公网安备 11011402011233号 京ICP备18060230号-3 营业执照 经营许可证:京B2-20212637