老师,您好,学习这套课程的应该有一部分是转行过来的,没有实际项目经验,这部分学员的简历该如何着手写呢?
期待回答,谢谢!
Process finished with exit code 0
老师控制台只显示这个死怎么回事
画出来的线段完全崩了,找不到原因
numpy np matplotlib.pyplot plt X = np.random.rand(,) () (X) () y = + *X + np.random.randn(,) X_b = np.c_[np.ones((,)),X] θ = np.linalg.inv(X_b.T.dot(X_b)).dot(X_b.T).dot(y) () (θ) () X_new = np.array([[], []]) X_new_b = np.c_[np.ones((,)),X_new] y_predict = X_new_b.dot(θ) () (y_predict) () plt.plot(X_new_b, y_predict,) plt.plot(X,y,) plt.axis([,,,]) plt.show()
那我直接鼠标移动到去修改不就好了, 这sio=io.StringID() 可变字符串的意义是什么?
视频里老师说session是threadlocal变量,这个之前讲过吗,是什么意思?
老师 selenium能否用来判断像金十数据这种不定时更新的数据?就是说我能否用selenium实现数据更新一次我就抓取一次,从而减少发送请求的频率?
老师,昨天那个问题解决了。但是我上传的时候包这个错,好像说,QQ邮箱没有验证通过,不能上传还是什么意思。error: Upload failed (403): The credential associated with user 'DuShangJiang' isn't allowed to upload to project 'baizhanMath'. See https://pypi .org/help/#project-name for more information.
class ComputerFactory: __obj = None __flag = True def __new__(cls, *args, **kwargs): if cls.__obj == None: #使用单例模式控制工厂对象的数量为1 cls.__obj = object.__new__(cls) return cls.__obj def __init__(self): if ComputerFactory.__flag: #使用单例模式初始化1次对象 self.__flag = False def create_computer(self,name): if name == '联想': return Lenvo().calculate() elif name == '华硕': return HuaShuo().calculate() elif name == '神舟': return ShenZhou().calculate() else: return '品牌不存在' class Computer: def calculate(self): print('身为品牌电脑,我们都有独自的logo') class Lenvo(Computer): print('联想1') def calculate(self): print('我是联想电脑,我的logo就是《》《》《》') class HuaShuo(Computer): print('华硕2') def calculate(self): print('我是华硕电脑,我的logo就是0 。0') class ShenZhou(Computer): print('神舟3') def calculate(self): print('我是神舟电脑,我的logo就是東風快递,使命必达!') fac = ComputerFactory() fac2 = ComputerFactory() c1 = fac.create_computer('华硕') # c2 = fac2.create_computer('神舟') print(fac._ComputerFactory__obj,1) print(fac2._ComputerFactory__obj,2) print(fac._ComputerFactory__flag,1) print(fac2._ComputerFactory__flag,2) print(fac2 is fac)
前端部分debug过了,后端这里没进来,打断点了哪几个按钮不亮,没执行进来,又要从哪里开始debug?
import time a =1000 def tes01(): start = time.time() global a for i in range(100000000): a += 1 end = time.time() print("time consume{0}".format((end-start))) def tes02(): start = time.time() c = 1000 for i in range(100000000): c += 1 end = time.time() print("time consume{0}".format((end-start))) test01() test02()
老师这个有什么问题?end-start 什么意思?
class MySingleton: __obj = None __init_flag = True def __new__(cls, *args, **kwargs): if cls.__obj == None: cls.__obj = object.__new__(cls) return cls.__obj def __init__(self,name): if MySingleton.__init_flag: print("init....") self.name = name MySingleton.__init_flag = False a = MySingleton("aa") print(a) b = MySingleton("bb") print(b)
老师,因为__init__第二次初始化对象失败,才会新建一个对象吗?
package com.bjsxt; import java.awt.*; import javax.swing.*; public class BallGame extends JFrame{ Image ball = Toolkit.getDefaultToolkit().getImage("images/ball.png"); Image desk = Toolkit.getDefaultToolkit().getImage("images/desk.png"); double x = 200; double y = 200; double degree = 3.14/3; //这里的3.14是弧度,3.14弧度=180度 boolean right =true; //控制小球的水平位移方向 //绘制窗口 public void paint(Graphics g){ System.out.println("窗口被画了一次!"); g.drawImage(desk,0,0,null); g.drawImage(ball,(int)x,(int)y,null); x = x + 10*Math.cos(degree); y = y + 10*Math.sin(degree); //遇到上下边界 if (y<70 || y>501-40-30){ degree = - degree; } if (x>856-40-30||x<40){ degree = 3.14- degree; } } //创建窗口 void launchFrame(){ setSize(856,501); setLocation(100,100); setVisible(true); //每秒绘制窗口25次 while (true){ repaint(); try { Thread.sleep(40); //1s = 1000ms ,1秒25次等价于40毫秒一次 } catch (InterruptedException e) { e.printStackTrace(); } } } public static void main(String[] args){ System.out.println("我的小游戏开始了!"); BallGame ballGame = new BallGame(); ballGame.launchFrame(); } }
老师我这个能跑起来,但是它的上边界有点问题,用
if (y<70 || y>501-40-30)
才能达到预期效果,我用QQ截图截了一下运行效果,发现它把框体的高度也算进去了。这是为什么呀
import pygame import os import time pygame.mixer.init() if os.path.isfile('E:/Python/My_My_PyM/Music_db/music/11.flac'): pygame.mixer.music.load('E:/Python/My_My_PyM/Music_db/music/11.flac') pygame.mixer.music.play() time.sleep(20)
import pygame # 初始化pygame pygame.init() # 加载音频文件 pygame.mixer.music.load('E:/Python/My_My_PyM/Music_db/music/11.flac') # 播放音频文件 pygame.mixer.music.play() # 等待音频播放完毕 while pygame.mixer.music.get_busy(): pygame.time.Clock().tick(10) # 关闭pygame pygame.quit()
视频中讲的方法,问答区里的方法,自己去网上找的方法都既不能播放mp3也不能播放flac
已知每个音频都可以用电脑自带的视频播放器正常播放
求老师解答
假设有一个部门一个人也没有,那么视频中将的查询部门名称和部门人数的方法不能包含没有人的部门啊
老师,我打开mysql连接报错了,这个怎么解决
非常抱歉给您带来不好的体验!为了更深入的了解您的学习情况以及遇到的问题,您可以直接拨打投诉热线:
我们将在第一时间处理好您的问题!
关于
课程分类
百战程序员微信公众号
百战程序员微信小程序
©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园网站维护:百战汇智(北京)科技有限公司 京公网安备 11011402011233号 京ICP备18060230号-3 营业执照 经营许可证:京B2-20212637