CW2-java测试项目:基础代码检验

版权申诉
0 下载量 162 浏览量 更新于2024-11-09 收藏 71KB RAR 举报
资源摘要信息:"CW2-java.rar_The Test" 文件标题和描述提示了该文件包含的内容与Java编程测试有关。文件名"CW2-java.rar"表明这是一个Java相关的测试文件,而"The Test"可能暗示这是一套测试用以检验Java基础知识的代码。该文件可能被设计为教学资源,用于评估或学习Java编程语言的基本概念和语法。 描述中的"java programme to test the basic code"意味着文件中包含了一系列的基础Java代码示例或练习,这些内容被用于测试或验证学习者对Java语言基础掌握的程度。该程序可能是用于教授Java编程的教师或学生设计的练习材料,或者是某种自动化的测试脚本,用于运行和检查Java代码的正确性。 标签"the_test"可能表示文件夹或文件的内容被归类在测试类别下,与教学、评估或自我检查有关。标签的使用有助于在大量资料中快速定位和识别特定的测试资源。 在"压缩包子文件的文件名称列表"中只提到了一个文件名"CW2 java.pdf"。这个文件可能是与上述Java测试相关的文档,例如测试指南、题目说明、参考答案或相关的教学指导。由于通常压缩文件的扩展名为".rar",而这里提到了一个PDF文件,我们可以推断出可能还存在其他的Java代码文件或资源未在此列表中显示,或者这个PDF文件本身就是关于如何使用或理解Java测试的关键资料。 综合以上信息,我们可以进一步探讨与Java编程语言基础相关的知识点,这些内容可能在文件"CW2 java.pdf"中被详细介绍。知识点可能包括但不限于以下方面: 1. Java语言基础:变量、数据类型、运算符、控制流(条件判断和循环控制)、数组等。 2. 面向对象编程基础:类和对象的定义、继承、多态、封装、抽象类和接口等。 3. Java核心API的使用:字符串操作、集合框架(如List、Set、Map等)、输入输出流(I/O)以及异常处理等。 4. Java标准库的运用:包括Math类、时间日期类、并发编程(线程和同步)等。 5. 面向测试的编程实践:单元测试(JUnit或其他测试框架)、测试驱动开发(TDD)等。 6. Java开发工具的使用:集成开发环境(IDE)的基本使用、构建工具(如Maven或Gradle)的基本操作等。 7. Java代码编写规范:命名规范、代码布局、注释习惯以及重构技巧等。 通过上述内容的学习和练习,学习者可以加深对Java编程语言的理解,提高解决问题的能力,并为之后的高级编程学习打下坚实的基础。需要注意的是,对于实际应用来说,将这些知识点转化为实际编码能力,还需要大量的编程实践和项目经验。

select lot_hs.lot_id as lot_id,lot_type,lot_hs.mainpd_id, created_time,COMPLETE_TIME, value(bank.banktime,0) as banktime , round ( ( 1.00*(days(COMPLETE_TIME)-days(created_time)) + (hour(COMPLETE_TIME)-hour(created_time))*1.00/24 + (minute(COMPLETE_TIME)-minute(created_time))*1.00/24/60 + (second(COMPLETE_TIME)-second(created_time))1.00/24/60/60) - value(bank.banktime,0),3) as use_days, customer_id, coalesce(cc.cust_id_define,lot_hs.customer_id) as cust_id2, cc.cycletime_target as ct_target, date,layer, round(count() over(partition by coalesce(cc.cust_id_define,lot_hs.customer_id),cc.cycletime_target)*0.9,0) cnt, row_number() over(partition by coalesce(cc.cust_id_define,lot_hs.customer_id),cc.cycletime_target order by ( ( days(COMPLETE_TIME)-days(created_time) + (hour(COMPLETE_TIME)-hour(created_time))*1.00/24 + (minute(COMPLETE_TIME)-minute(created_time))*1.00/24/60 + (second(COMPLETE_TIME)-second(created_time))*1.00/24/60/60) - value(bank.banktime,0))/layer) id From (select date(a.claim_time) as date, a.lot_id, a.lot_type,a.mainpd_id,a.prodspec_id,a.custprod_id, case when(date(b.created_time) <= '2009-01-05') then b.created_time + 21 days else b.created_time end as created_time, CASE WHEN A.CUST_id in ('MCA','NPA','SET') THEN a.COMPLETE_TIME ELSE a.COMPLETE_TIME END COMPLETE_TIME, a.cust_id as customer_id, a.ope_category, c.layer From f3rpt.F3_TB_DAILY_FABOUT a, f3rpt.fvlot b, (select mainpd_id, sum(masks)layer from f3rpt.ASMCRPT_VW_MAINPD_MASKS_ALL group by mainpd_id) as c, (select * from (select lot_id, max(claim_time)claim_time, count(case when(ope_category='Ship')then lot_id else null end) as LS, count(case when(ope_category='Unship') then lot_id else null end) as LUS from f3rpt.F3_TB_DAILY_FABOUT where substr(lot_id,1,2) not in('CA','CW','ES','E0','EM') and lot_type = 'Production' AND LOT_ID NOT LIKE 'H%' and substr(lot_id,7,4)='.00F' and ope_category in ('Ship','Unship') and year(claim_time) = year(current date - 1 days) and month(claim_time) = month(current date - 1 days) group by lot_id) as a where LS - LUS > 0 ) as lot Where a.lot_id = b.lot_id and b.mainpd_id = c.mainpd_id and a.lot_id = lot.LOT_ID and a.claim_time = lot.claim_time and a.ope_category = 'Ship' and a.cust_id in ('SM','BOE','GSC','NPA','GTA') ) as lot_hs left outer join (select lot_id,max(bankin_time) banktime from f3rpt.asmc_dpm where bankin_time>0 group by lot_id) bank on (lot_hs.lot_id = bank.lot_id) left join f3cim.f3cim_cfg_cust_rule cc on case when lot_hs.customer_id='WXM' THEN 'WII'||SUBSTR(lot_hs.mainpd_id,6,1) else lot_hs.customer_id end = cc.cust_id and locate(cc.mainpd_id,lot_hs.mainpd_id)>0 and locate(cc.prodspec_id,lot_hs.prodspec_id)>0 and locate(cc.custprod_id_45,substr(lot_hs.custprod_id,3,3))>0 where lot_hs.ope_category = 'Ship' ;以上sql如何优化

2023-06-07 上传
111 浏览量

import sensor, image, time,math,pyb from pyb import UART,LED import json import ustruct sensor.reset() sensor.set_pixformat(sensor.RGB565) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) # must be turned off for color tracking sensor.set_auto_whitebal(False) # must be turned off for color tracking red_threshold_01=(10, 100, 127, 32, -43, 67) clock = time.clock() uart = UART(3,115200) #定义串口3变量 uart.init(115200, bits=8, parity=None, stop=1) # init with given parameters def find_max(blobs): #定义寻找色块面积最大的函数 max_size=0 for blob in blobs: if blob.pixels() > max_size: max_blob=blob max_size = blob.pixels() return max_blob def sending_data(cx,cy,cw,ch): global uart; #frame=[0x2C,18,cx%0xff,int(cx/0xff),cy%0xff,int(cy/0xff),0x5B]; #data = bytearray(frame) data = ustruct.pack("<bbhhhhb", #格式为俩个字符俩个短整型(2字节) 0x2C, #帧头1 0x12, #帧头2 int(cx), # up sample by 4 #数据1 int(cy), # up sample by 4 #数据2 int(cw), # up sample by 4 #数据1 int(ch), # up sample by 4 #数据2 0x5B) uart.write(data); #必须要传入一个字节数组 while(True): clock.tick() img = sensor.snapshot() blobs = img.find_blobs([red_threshold_01]) cx=0;cy=0; if blobs: max_b = find_max(blobs) #如果找到了目标颜色 cx=max_b[5] cy=max_b[6] cw=max_b[2] ch=max_b[3] img.draw_rectangle(max_b[0:4]) # rect img.draw_cross(max_b[5], max_b[6]) # cx, cy FH = bytearray([0x2C,0x12,cx,cy,cw,ch,0x5B]) #sending_data(cx,cy,cw,ch) uart.write(FH)

198 浏览量