方晨Flash CS3中文实例教程:绘图、动画与编程

需积分: 9 1 下载量 176 浏览量 更新于2024-07-16 收藏 39.27MB PDF 举报
"《Flash+CS3+中文版实例教程》是方晨编著的一本针对初学者和专业设计师的教材,主要讲解Adobe Flash CS3软件的使用。该教程分为三个主要部分:绘图、动画制作和编程。以下是各部分的详细知识点: 1. 第1章 - Flash CS3快速入门 - 本章旨在让读者熟悉Flash CS3的基本功能和应用场景。Flash CS3提供了关键的三大功能: - 绘图功能:支持图形绘制和特殊字形处理,适合美工人员进行多媒体素材创作。 - 动画功能:强大的动画工具可用于制作高质量的动画,无论是初学者还是专业开发者都能轻松创建精彩动画。 - 编程功能:利用其交互式编程能力,可以实现复杂的用户交互,如游戏开发。 - 实际应用包括:图形绘制、动画制作(如动态网页设计和简单的网站构建)、以及游戏设计。 - Flash CS3的工作界面包括菜单栏(操作命令集)、时间轴(控制影片播放)、工具箱(绘图工具)、舞台(动画表演空间)、属性面板(管理对象属性)和面板组(多功能工具集合)。 2. 后续章节:教程可能还会深入讲解如何在各个面板之间流畅工作,如何创建和编辑元件、动画帧,以及如何编写ActionScript代码来实现交互逻辑。章节可能会涉及帧动画、补间动画、逐帧动画的区别,以及如何利用事件和脚本来驱动动画和交互行为。 在整个教程中,作者会通过实例演示的方式,帮助读者从基础到进阶逐步掌握Flash CS3的使用技巧,适合希望通过实践学习和提升Flash技能的人群。学习过程中,不仅要有理论知识,还要结合实际操作,才能真正掌握这门强大的工具。"

import pymysql import time while True: # 连接源数据库 src_conn = pymysql.connect(host='10.43.64.110', port=3306, user='selectuser', password='Xy@123456', database='messpdb') print("连接源数据库成功") # 连接目标数据库 dst_conn = pymysql.connect(host='10.43.144.231', port=3306, user='root', password='123456', database='czjsc') print("连接目标数据库成功") # 创建源游标对象 src_cursor = src_conn.cursor() # 创建目标游标对象 dst_cursor = dst_conn.cursor() # 编写SQL查询语句 #各牌号烟丝总重量 sql1 = 'select mat_id,material_name ,ROUND (sum(quantity) ,1 ) weight ,unit_id from messpdb.silk_stock a left join messpdb.maindata_material b on a.mat_id =b.ctrl where mat_id >0 group by mat_id,material_name, unit_id' sql2 = "select ROUND (sum(quantity) ,1 ) weight ,unit_id from messpdb.silk_stock a where mat_id >0 group by unit_id" sql3 = "select aa.ids,ROUND (aa.c1/bb.c2 ,3 )*100 from (select 1 as ids,count(box_code) c1 from messpdb.silk_stock a where mat_id >0 group by ids) aa, (select 1 as ids,count(box_code) c2 from messpdb.silk_stock a group by ids)bb where aa.ids=bb.ids" # 执行SQL查询语句 src_cursor.execute(sql1) src_cursor.execute(sql2) src_cursor.execute(sql3) # 获取查询结果 results1 = src_cursor.fetchall() results2 = src_cursor.fetchall() results3 = src_cursor.fetchall() print("查询数据库成功") # 更新数据到目标数据库 for row in results1: mat_id = row[0] material_name = row[1] weight = row[2] unit_id = row[3] # 将数据更新到目标数据库中 update_sql = "update cs_list set material_name=%s, weight=%s, unit_id=%s where mat_id=%s" dst_cursor.execute(update_sql, (material_name, weight, unit_id, mat_id)) print("更新数据成功") # 更新数据到目标数据库 for row in results2: weight = row[0] unit_id = row[1] # 将数据更新到目标数据库中 update_sql = "update cs2_list set weight=%s, unit_id=%s where id=1" dst_cursor.execute(update_sql, (weight, unit_id)) for row in results3: ids = row[0] stock_ratio = row[1] # 将数据更新到目标数据库中 update_sql = "update cs3_list set stock_ratio=%s where id=1" dst_cursor.execute(update_sql, stock_ratio) # 提交事务并关闭连接 dst_conn.commit() dst_cursor.close() src_cursor.close() dst_conn.close() src_conn.close() print("断开数据库连接成功") time.sleep(1) 帮我debug

2023-06-02 上传

请解释分析下面这段程序:%%%无序充电投标 clear clc load data_disorder Pch=[Pch_CS1_disorder;Pch_CS2_disorder;Pch_CS3_disorder;Pch_CS4_disorder];%充电站充电功率 %市场出清问题 Link=zeros(24,96);%时段换算矩阵(日前1h换算为实时15min) for i=1:24 Link(i,4*i-3:4*i)=1; end Loadcurve=[0.955391944564747,0.978345604157644,1,0.995019488956258,0.972932005197055,0.970333477695972,0.930489389346037,0.890428757037679,0.902771762667822,0.941966219142486,0.911000433087917,0.862061498484192,0.840190558683413,0.831095712429623,0.756604590731919,0.671719359029883,0.611520138588133,0.582936336076224,0.572542226071893,0.574707665656128,0.587267215244695,0.644218276310091,0.755521870939801,0.884798614118666]; Loadcurve=Loadcurve*Link;%换成96个时段 PL_base=[5.704;5.705;5.631;6.518;4.890;5.705;5.847]*1000;%负荷分布 PL=PL_base*Loadcurve;%基础负荷(负荷曲线从08:00开始算起,即第9个时段) Pf=sdpvar(7,96);%馈线功率 Pf(1,:)=PL(1,:)+Pch(1,:);Pf(2,:)=PL(2,:);Pf(3,:)=PL(3,:);Pf(4,:)=PL(4,:)+Pch(2,:);Pf(5,:)=PL(5,:)+Pch(3,:);Pf(6,:)=PL(6,:);Pf(7,:)=PL(7,:)+Pch(4,:);%馈线功率组成 Pg=sdpvar(10,96);%发电商分段电量 Pg_step=1000*[20,5,3,2,2,2,2,2,2,inf]';%报价区间 Price_DSO=[3:12]'*0.1;%分段电价 Obj=0.25*sum(sum((Price_DSO*ones(1,96)).*Pg));%目标为用电费用最小 Constraint=[0<=Pg<=Pg_step*ones(1,96),sum(Pg)==sum(Pf)];%约束条件 optimize(Constraint,Obj);%求解线性规划问题 Pg=double(Pg);%发电机功率 Pf=double(Pf);%馈线功率 isPg=(Pg>0);%为了计算出清电价,计算发电机分段选择情况 DLMP=sum(isPg)/10+0.2;%出清电价计算 %绘图 figure(1)%节点边际电价 stairs(DLMP); xlabel 时间 ylabel 电价(元/kWh) ylim([0.3,1.3]) figure(2)%负荷曲线 hold on plot(sum(PL)/1000); plot(sum(Pf)/1000,'r.-'); xlabel 时间 ylabel 负荷(MW) legend('基础负荷','无序充电负荷') Cost=sum(sum(Pch).*DLMP);%总用电费用 result_disorder.Cost=Cost;result_disorder.DLMP=DLMP;result_disorder.Pf=Pf;result_disorder.Pg=Pg;%结果保存 save('result_disorder','result_disorder');

2023-06-14 上传