1、标签里面什么时候用<a></a>,什么时候用<p></p>,什么时候用<u></u>是有规定的吗?
还是需要记住,通过长时间练习养成习惯性记忆?
2、这是属于标签嵌套标签吗?
3、有没有什么规定或者规律,还是说可以随意嵌套?
创建类视图时,是不是所有的方法后面都要加上 .as_view()(即上面标注的红色部分)。而且是固定的只加.as_view()呢 。
老师,我将数据包导入以后,没有出现连接地址,出错了是什么情况?
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. null at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at com.mysql.jdbc.Util.handleNewInstance(Util.java:409) at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1122) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2260) at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:787) at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:49) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at com.mysql.jdbc.Util.handleNewInstance(Util.java:409) at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:357) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285) at java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:247) at cn.sxt.dubtil111.DBUtil.getConnection(DBUtil.java:25) at cn.sxt.dubtil111.DBUtil.main(DBUtil.java:51) Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at com.mysql.jdbc.Util.handleNewInstance(Util.java:409) at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1122) at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:344) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2181) ... 13 more Caused by: java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at java.net.Socket.connect(Socket.java:538) at java.net.Socket.<init>(Socket.java:434) at java.net.Socket.<init>(Socket.java:244) at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:256) at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:293) ... 14 more
出现了以上错误!
老师,您好,在自动向上转型和强制向下转型当中,底层内部是怎么变化的?
class A: pass class B: pass class D(B,A): pass class C(A,B): pass class E(C,D): pass
问题:为何这个多重继承会报错呢?
————————————————————
老师,怎么用连接查询解决这道题。视频中用的子查询。
显示那些 job ID 与雇员 141 相同的雇员的名字与 job ID。
package cn.sxt.pool108; import java.util.ArrayList; import java.util.List; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; public class Test02 { public static void main(String[] args) throws InterruptedException, ExecutionException { // 如何创建一个线程池 // 1.创建一个线程池,线程池中只有一个线程对象 //ExecutorService pool = Executors.newSingleThreadExecutor(); // 2.创建一个线程池,线程池中有线程的数量固定 ExecutorService pool = Executors.newFixedThreadPool(10); // 3.创建一个线程池,线程池中的线程的数量可以动态的改变 //ExecutorService pool = Executors.newCachedThreadPool(); //创建一个集合 List<Future> list = new ArrayList<Future>(); /**使用线程池执行大量的Callable任务*/ for(int i=0;i<20;i++) { //使用匿名内部类 //创建任务 Callable<Integer> task = new Callable<Integer>() { @Override public Integer call() throws Exception { Thread.sleep(2000); return (int)(Math.random()*10)+1; } };//任务结束 //将任务交给线程池 Future f = pool.submit(task); //每执行完一个任务就将它添加到集合当中去 list.add(f); //System.out.println(f.get()); } System.out.println("ok?"); //任务全部执行完毕之后再去遍历集合 for (Future future : list) { System.out.println(future.get()); } System.out.println("OKOK!"); //关闭线程池 pool.shutdown(); } }
问题一:在以上代码中,用线程池中的10个线程去执行,执行System.out.println(f.get());时为什么会一个一个执行呢?
问题二:用线程池中的10个线程去执行,加入ArrayList时,ArrayList是有序的,那是不是实际上还是10个线程同时执行,线程每执行完一个任务就将它添加到集合中去了?还是一下子同时执行完10个任务再一个一个添加到集合中?
问题三:在上一个程序中加入final,是不是为了提高程序的安全性?还是有其他的作用?
已经明白了,老师,不用回了,谢谢老师,一个小bug我没发现到,少了个括号
class ComputerFactory: __obj = None __init_flag = True __countLenovo = 0 __countAsus = 0 __countHasee = 0 def __new__(cls, *args, **kwargs): #单例模式 if cls.__obj==None: cls.__obj = object.__new__(cls) return cls.__obj #new方法创建完成一定要返回我们的实例对象 def __init__(self): #单例模式 if ComputerFactory.__init_flag: print('构造初始化') ComputerFactory.__init_flag = False def produce(self,brand): #工厂模式 if brand =='联想': ComputerFactory.__countLenovo += 1 return Lenovo() elif brand == '华硕': ComputerFactory.__countAsus += 1 return Asus() elif brand == '神舟': ComputerFactory.__countHasee += 1 return Hasee() def calculate(self): a = [ComputerFactory.__countAsus,ComputerFactory.__countLenovo,ComputerFactory.__countHasee] print('本公司一共生产了{0}台电脑'.format(sum(a)) class Computer: __count = 0 def __init__(self): Computer.__count +=1 def calculate(self): print('生产了{0}台电脑'.format(Computer.__count)) class Lenovo(Computer): __num = 0 def __init__(self): # Computer.__init__(self) Lenovo.__num +=1 def calculate(self): print('共生产了{0}个联想电脑'.format(Lenovo.__num-1)) class Asus(Computer): __num = 0 def __init__(self): # Computer.__init__(self) Asus.__num += 1 def calculate(self): print('共生产了{0}个联想电脑'.format(Asus.__num-1)) class Hasee(Computer): __num = 0 def __init__(self): # Computer.__init__(self) Hasee.__num += 1 def calculate(self): print('共生产了{0}个联想电脑'.format(Hasee.__num-1)) t = ComputerFactory() h = Computer() t.produce('联想') h.calculate() Lenovo().calculate() t.calculate() Lenovo().calculate()
问题:不知道为啥会报这样的错,我反复核实没有格式的错误啊,求指导!老师
老师,我听完视频讲完原理明白了HashMap是如何存取值的,但我再去看JDK源码的时候发现阅读HashMap的源码不是一般的难,看网上的源码分析也看不懂,不像ArrayList和LinkedList那样好理解,然后再用自己手写的方法还原HashMap的基本方法也无法很好还原,这种情况该怎么办呢
-----------------------------------------------------------------
老师最后一道题:
视频主讲老师的答案:
80" ,sum(decode(department_id,90,salary))"D
ep 90"from employees group by job_id;
结果:
题目要求是统计
但是老师最后的结果是把每一个部门的薪水返回到对应位置了,eg20部门在第三列,为13000和6000,但不应该是返回一个结果19000吗?我自己试了半天也实现不了
multiprocessing Queue q = Queue() q.put() q.put() q.put() q.put() (q.qsize()) (q.full()) (q.get()) (q.qsize())
问题:
Queue(3)限制了队列中存储消息数目为3,为什么写入4条信息的时候不报错,而程序不继续往下执行?
老師把 SELECT JOB_ID,SALARY,LAST_NAME FROM EMPLOYEES WHERE JOB_ID ='SA_REP' OR JOB_ID='AD_PRES' AND SALARY>15000;改成SELECT JOB_ID,SALARY,LAST_NAME FROM EMPLOYEES WHERE JOB_ID IN ('SA_REP' , 'AD_PRES' ) AND SALARY >15000;爲什麽不行?
JOB_ID IN ('SA_REP' , 'AD_PRES' )括號里不就是相當于or么?
老师 我在cmd里面输入sqlplus/nolog 后 之后在输入conn / as sysdba 提示我权限不够 怎么回事呀
还有就是我用PLsql登陆的时候选择sysdba模式登陆 也提示权限不够 但是以nomal方式登陆可以成功登录并且也可以在SQL命令窗口中创建用户 怎么回事 希望解答一下
在进行压力测试的时候,并发量稍高就会报错,好像是请求输入流没有拿到,由于是在服务器上压测,所以没法打断点,请老师帮忙看下原因,谢谢。
代码地址:https://github.com/niliv/practice/tree/master/java/bz/MyWebServer/src
压测工具:http_load
压测链接
非常抱歉给您带来不好的体验!为了更深入的了解您的学习情况以及遇到的问题,您可以直接拨打投诉热线:
我们将在第一时间处理好您的问题!
关于
课程分类
百战程序员微信公众号
百战程序员微信小程序
©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园网站维护:百战汇智(北京)科技有限公司 京公网安备 11011402011233号 京ICP备18060230号-3 营业执照 经营许可证:京B2-20212637