第四次作业

MYSQL第四次作业 -- 创建歌手表 CREATE TABLE singer( sin_id INT PRIMARY KEY , -- 主键,歌手编号 sin_name VARCHAR(50), -- 歌手姓名 sin_birthday DATETIME, -- 歌手生日 sin_region VARCHAR(50) -- 歌手地区 ); -- 查全表 SELECT * FROM singer; -- 增... 阅读详情

第一题

代码:

def findDuplicate1(nums):
    num_set = set()
    for num in nums:
         if num in num_set:
             return num
         num_set.add(num)
    return -1
l1 = [1, 2, 3, 4, 5, 6, 7, 8,1]
print(findDuplicate1(l1))

运行结果:

第二题

代码:

username = input("请输入用户名:")
password = input("请输入密码:")
import pickle
import time
current_time = time.strftime("%H:%M:%S")
username_mysql = pickle.dumps("zhangsan")
password_mysql = pickle.dumps("123")
def add_time_func(current_time):
    def inner(func):
       def wrapper(*args,**kwargs):
         #增强内容
        res = func(*args,**kwargs)
        try:
             with open("login.txt","a+",encoding="utf-8")as f:
                 f.write(f"{username},{password},写入时间:{current_time}\n")
        except Exception as e:
             print(e)
        return(res)
       return wrapper#实现增强细节
    return inner #增强原函数

@add_time_func(current_time)
def login(username, password):
    if (username ==pickle.loads(username_mysql) and
       password ==pickle.loads(password_mysql)):
          return "success"
    else:
          return "failure"
if __name__ == '__main__':
 print(login(username.strip(), password.strip()))

运行结果:

第三题

代码:

a = 23
b = -17
"""
23: 0001 0111
-17:1110 1111
"""
print(a & b)#0000 0111
print(a | b)#0000 0001
print(a ^ b)#0000 1000
print(~a)   #0001 1000
print(~b)   #0001 0000
print(a<<2) #0101 1100
print(b<<2) #0100 0100
print(a>>2) #0000 0101
print(b>>2) #0000 0101

运行结果:

合成厨房第四次作业报告ppt 合成厨房第四次作业报告ppt。 阅读详情

相关推荐

RTC温度补偿:如何让时间分秒不差?

RTC(实时时钟)温度补偿技术通过"检测温度→计算误差→动态调整频率"的闭环机制,解决振荡器频率随温度变化导致的时间误差问题。核心步骤包括:1)高精度温度检测;2)基于温度-频率误差模型计算偏差;3)通过硬件(可编程电容/DAC)或软件方式调整振荡频率。该技术需突破温度检测精度、误差模型拟合、频率调整分辨率等关键点,根据不同应用场景(消费电子±5ppm至军工±0.1ppm)选择匹配方案。典型实现如STM32的分段线性补偿算法,可将工业级RTC精度提升至±2ppm以内。

上市公司前技术负责人,20 年软硬件深耕 + 百人研发团队管理经验,名校理工科背景加持。从技术攻坚到团队掌舵,沉淀海量项目实战与管理心得,专注分享软硬件干货、疑难问题解决方案,既是靠谱知识传播者,也盼链接优质项目共成长。 1229

c++第四次上机作业

/*   * 文件名称:Ex1-1.cpp   * 作    者:曾辉   * 完成日期:2017 年 4月 21 日   * 版 本 号:v1.0   * 对任务及求解方法的描述部分:  * 输入描述:无   * 问题描述:第四次上机作业  * 程序输出:  * 问题分析:略  * 算法设计:略   */     #include int main() { int

taoyingrui的博客 373

Flink SQL数据血缘实战:如何用Calcite追踪字段级数据流向(附源码示例)

本文深入探讨了如何利用Apache Calcite解析Flink SQL执行计划,实现字段级数据血缘的追踪。通过扩展Calcite的元数据处理器,特别是针对Flink特有的Snapshot等节点,文章提供了从获取优化后的逻辑计划到提取并可视化血缘关系的完整实战方案,并附有核心源码示例,帮助开发者构建实时数仓的数据治理能力。

weixin_29032337的博客 142

机器人技术第四次作业

机器人技术第四次作业 2018218779 邹鹏

Zone的博客 1960

告别第三方控件!C#实现OPC UA客户端,对接工业设备超简单

C#实现OPC UA客户端无需依赖第三方商业控件,通过快速起步:通过NuGet安装,使用模拟器完成前期开发测试;复用性强:封装通用工具类,支持连接、读写、订阅等核心功能,可直接集成到各类上位机项目;界面友好:通过WinForm绑定工具类,实现可视化操作,适配工业现场人员使用;工业适配:支持安全配置、身份验证,联调步骤清晰,可快速对接西门子、欧姆龙等主流工业设备;稳定性高:具备资源释放、异常处理、线程安全UI更新等特性,满足工业7×24小时运行要求。

这里只有干货:从 Modbus 通信到 MES 对接,从 YOLO 训练到工控机部署,带你搞定工业软件开发全流程。 1363

华为OD新系统机试真题 - 准备生日礼物(Py/Java/C/C++/Js/Go)

华为OD机试新系统真题 4.8【准备生日礼物】,提供C语言、Java、C++、Python、Go、JavaScript源码实现,并提供完整思路讲解,以及在线OJ模拟做题。华为OD机试真题【准备生日礼物】

qq_45776114的博客 1478

人工智能原理与算法第四次作业

第四次作业

weixin_44559265的博客 883

内容审核与文本安全技术综述:检测、过滤与对齐

检测质量高度依赖数据。毒性/仇恨/冒犯语言检测领域形成了一批经典数据集,但它们的标签体系差异很大:例如 OLID(OffensEval)强调“是否冒犯—冒犯类型—目标对象”三层结构;HateXplain 在“hate/offensive/normal”三分类之外,还提供目标群体与人类标注的 rationale span;RealToxicityPrompts 则不做离散标签,而是用毒性分数来研究“模型续写时的毒性退化”。ACL 汇编。

nmdbbzcl的博客 1371

操作系统第四次作业

![在这里插入图片描

qq_50160761的博客 139

用一张分析型 CDS Query 看清争议案件新增与结案节奏:C_OpenClosedDisputeCase 深度解读

应收账款争议管理中的关键CDS视图分析 摘要:C_OpenClosedDisputeCase是SAP系统中用于监控应收账款争议案件的重要CDS视图,提供三个时间窗口(当日、近5天、当月)的新增与结案数据。该视图通过"创建vs解决"的净变化指标,帮助财务团队实时掌握争议管理趋势,特别适用于多币种跨国企业的现金流管理。其核心价值在于将争议管理从被动"救火"转变为可量化运营,通过统一汇率换算和关键日期参数,为管理层提供标准化的运营仪表盘。视图采用特权访问模式,需通过上层应用

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 122

使用再生龙备份还原liunx系统(精确每一步)

再生龙镜像可自行到官网下载(ISO/ZIP格式均可),然后使用tuxboot烧录工具制作启动盘,另外准备一个U盘用来存储备份的镜像文件,即再生龙盘和存储盘是两个分开的。当然也可以用分区工具把同一个硬盘分区来使用,比较方便,先学会基本的吧,只是告诉有个捷径,省个U盘。

米可的博客! 8367

HCIA第四次作业

leisurekuan的博客 137

【25届数字IC秋招总结】面试经验15——比特大陆-算能

25届数字ic面试记录——比特大陆-算能

lalala0635的博客 554

ensp第四次作业

ensp第四次作业,华珠电动2407肖国庆。

Little_Xiao862的博客 121

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

寒假班第四次作业

只做到了这么多

QJRSO的博客 101

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

上一篇: 第三次作业
下一篇: 第五次作业
Fu206721
博客等级 码龄2年 43粉丝 46原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值