




已阅读5页,还剩39页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Verilog/Xilinx五级流水CPU代码,WebUploader的java后端上传代码(支持分片上传),WIN32贪食蛇改进版,新增计分、等级及暂停功能,Windows下用SDL2实现一个简单的五子棋windows编程c/c+获取域名的IP地址,安装brewShell/批处理,安卓找图有什么好的算法安卓图片异步加载工具类,安卓自定义PagerAdapter类,按状态统计tcp连接数量&sort使用,把ByteArrayOutputStream直接作为输入流,百度前端技术学院学习:三行自适应布局代码 Flash/ActionScript/Flex代码 var startTime:uint = getTimer();var t:Array = new Array(12515,123232,1515);t0 = 1232323;t0 = new Array(1, 2, 3, 4, 1987, 1988, 1989, 19901, 19902, 19903, 199031, 199032, 199033 );t = 10, 5425, 156, 10000, PHP, true, 0.52455, -15, -132213656565, null, undefined;tP = PPPPPPP;tobj = -15455555;tlist = 5, 56556,2656,565,665,656,59,5656565656,656556,4999,5625623,2656,222,212122,65656,999,998956,22633,22666,1484223,10,20,30,40,50,60,70, 71, 72, 73, 74, 75, 76,771, 772, 773, 774, 775, 7761, 7762, 7763, 7764, 77641, 77642, 77643, 77644;var obj = a:A,b:B,c:c1:C1,c2:C2,d:D;/C#隐式转换/显式转换(implicit/explicit)/trace(typeof Array);/trace(typeof Object);/c#代码样例-S05GK接口发送短信function printArray(array:Object, indent = ) for (var i in array) if (arrayi is Array) trace(indent, i+ = Array (); /数组 printArray(arrayi, indent+ ); /递归循环 trace(indent, ); else if (arrayi is Number) if (arrayi is int) if (arrayi is uint) trace(indent, i+ = (Unit) +arrayi);/无符号整数 else trace(indent, i+ = (Int) +arrayi);/有符号整数 else trace(indent, i+ = (Number) +arrayi);/浮点数 else if (arrayi is String) trace(indent, i+ = (String) +arrayi);/字符串 else if (arrayi is Boolean) trace(indent, i+ = (Boolean) +arrayi);/布尔值 else if (arrayi = null) trace(indent, i+ = (Null) +arrayi);/空值 else trace(indent, i+ = (?) +arrayi);/未知类型 /Boolean(布尔)、int(有符整型)、Number(浮点)、String(字符串)、uint(无符整型) printArray(t);/printArray(obj);var endTime:uint = getTimer();trace(运行需时:, endTime - startTime, 毫秒);代码 Flash/ActionScript/Flex代码 /*/运行输出结果: 0 = Array ( 0 = (Unit) 1 1 = (Unit) 2 2 = (Unit) 3 3 = (Unit) 4 4 = Array ( 0 = (Unit) 1987 1 = (Unit) 1988 2 = (Unit) 1989 3 = Array ( 0 = (Unit) 19901 1 = (Unit) 19902 2 = (Unit) 19903 3 = Array ( 0 = (Unit) 199031 1 = (Unit) 199032 2 = (Unit) 199033 ) ) ) ) 1 = (Unit) 123232 2 = (Unit) 1515 3 = Array ( 0 = (Unit) 10 1 = Array ( 0 = (Unit) 5425 1 = (Unit) 156 ) 2 = (Unit) 10000 3 = (String) PHP 4 = (Boolean) true 5 = (Number) 0.52455 6 = (Int) -15 7 = (String) -132213656565 8 = (Null) null 9 = (Null) undefined ) P = (String) PPPPPPP obj = (Int) -15455555 list = Array ( 0 = (Unit) 5 1 = (Unit) 56556 2 = (Unit) 2656 3 = (Unit) 565 4 = (Unit) 665 5 = (Unit) 656 6 = (Unit) 59 7 = Array ( 0 = (Number) 5656565656 1 = (Unit) 656556 2 = (Unit) 4999 ) 8 = (Unit) 5625623 9 = (Unit) 2656 10 = (Unit) 222 11 = Array ( 0 = (Unit) 212122 1 = (Unit) 65656 2 = (Unit) 999 3 = (Unit) 998956 4 = (Unit) 22633 5 = (Unit) 22666 6 = (Unit) 1484223 7 = Array ( 0 = (Unit) 10 1 = (Unit) 20 2 = (Unit) 30 3 = (Unit) 40 4 = (Unit) 50 5 = (Unit) 60 6 = Array ( 0 = (Unit) 70 1 = (Unit) 71 2 = (Unit) 72 3 = (Unit) 73 4 = (Unit) 74 5 = (Unit) 75 6 = (Unit) 76 7 = Array ( 0 = (Unit) 771 1 = (Unit) 772 2 = (Unit) 773 3 = (Unit) 774 4 = (Unit) 775 5 = Array ( 0 = (Unit) 7761 1 = (Unit) 7762 2 = (Unit) 7763 3 = (Unit) 7764 4 = Array ( 0 = (Unit) 77641 1 = (Unit) 77642 2 = (Unit) 77643 3 = (Unit) 77644 ) ) ) ) ) ) )运行需时: 63 毫秒*/代码 获取百度的热词 /* * 获取百度的热词 * user 小杰 * from isharey/?p=354 * return array 返回百度的热词数据(数组返回) */function getBaiduHotKeyWord() $templateRss = file_get_contents(top.baidu/rss_xml.php?p=top10); If (preg_match(/(.*)/is, $templateRss, $_description) $templateRss = $_description 0; $templateRss = str_replace(&, &, $templateRss); $templateRss = . $templateRss; $xml = simplexml_load_String($templateRss); foreach ($xml-tbody-tr as $temp) if (!empty ($temp-td-a) $keyArray = trim($temp-td-a); return $keyArray;代码 Java代码 import javax.media.*;public class StateHelper implements ControllerListener public StateHelper (Player p) player = p; p.addControllerListener(this); public boolean configure (int timeOutMillis) long startTime = System.currentTimeMillis(); synchronized (this) if (player instanceof Processor) (Processor)player).configure(); else return false; while(!configured & !failed) try wait(timeOutMillis); catch (InterruptedException e) / TODO: handle exception if(System.currentTimeMillis() - startTime timeOutMillis) break; return configured; public boolean prefetch(int timeOutMillis) long startTime = System.currentTimeMillis(); synchronized (this) player.prefetch(); while(!prefetched & !failed) try wait(timeOutMillis); catch (InterruptedException e) / TODO: handle exception if(System.currentTimeMillis() - startTime timeOutMillis) break; return prefetched & !failed; public boolean realize(int timeOutMillis) long startTime = System.currentTimeMillis(); synchronized (this) player.realize(); while(!realized & !failed) try wait(timeOutMillis); catch (InterruptedException e) / TODO: handle exception if(System.currentTimeMillis() - startTime timeOutMillis) break; return realized; public boolean playToEndOfMedia(int timeOutMillis) long startTime = System.currentTimeMillis(); eom = false; synchronized (this) player.start(); while(!eom & !failed) try wait(timeOutMillis); catch (InterruptedException e) / TODO: handle exception if(System.currentTimeMillis() - startTime timeOutMillis) break; return eom & !failed; public void close() synchronized (this) player.close(); while(!closed) try wait(100); catch (InterruptedException e) / TODO: handle exception player.removeControllerListener(this); Override public synchronized void controllerUpdate(ControllerEvent e) if(e instanceof RealizeCompleteEvent) realized = true; else if(e instanceof ConfigureCompleteEvent) configured = true; else if(e instanceof PrefetchCompleteEvent) prefetched = true; else if(e instanceof EndOfMediaEvent) eom = true; else if(e instanceof ControllerErrorEvent) failed = true; else if(e instanceof ControllerClosedEvent) closed = true; else return; notifyAll(); boolean configured = false; boolean realized = false; boolean prefetched = false; boolean closed = false; boolean failed = false; boolean eom = false; Player player = null;文件 Sender.java7KB(556) package rtp_test;import java.awt.Dimension;import java.io.IOException;import java.InetAddress;import java.UnknownHostException;import javax.media.CaptureDeviceInfo;import javax.media.CaptureDeviceManager;import javax.media.Codec;import javax.media.Control;import javax.media.Format;import javax.media.Manager;import javax.media.NoProcessorException;import javax.media.Owned;import javax.media.Processor;import javax.media.control.FormatControl;import javax.media.control.QualityControl;import javax.media.control.TrackControl;import javax.media.format.AudioFormat;import javax.media.format.UnsupportedFormatException;import javax.media.format.VideoFormat;import tocol.ContentDescriptor;import tocol.DataSource;import tocol.PushBufferDataSource;import tocol.PushBufferStream;import javax.media.rtp.InvalidSessionAddressException;import javax.media.rtp.RTPManager;import javax.media.rtp.SendStream;import javax.media.rtp.SessionAddress;public class Sender public static void main(String args) try /设置本地地址和远端地址都为本机地址,自己传给自己,试验用 SessionAddress local = new SessionAddress(InetAddress.getLocalHost(),50000); SessionAddress target = new SessionAddress(InetAddress.getLocalHost(),60000); new Sender(local,target); catch (UnknownHostException e) e.printStackTrace(); public Sender(SessionAddress local,SessionAddress target) CaptureDeviceInfo info = (CaptureDeviceInfo) CaptureDeviceManager.getDeviceList(new VideoFormat(null).get(0);/ CaptureDeviceInfo info = (CaptureDeviceInfo) CaptureDeviceManager.getDeviceList(new AudioFormat(null).get(0);用这一句替换上一句可改成音频传输 Processor p = null; try p = Manager.createProcessor(info.getLocator(); catch (NoProcessorException | IOException e) e.printStackTrace(); StateHelper sh = new StateHelper(p); doSomeVideoProcess(p,sh);/ doSomeAudioProcess(p,sh);用这一句替换上一句可改成音频传输 RTPManager mgr = RTPManager.newInstance(); try mgr.initialize(local); mgr.addTarget(target); catch (InvalidSessionAddressException | IOException e) e.printStackTrace(); DataSource ds = p.getDataOutput(); PushBufferDataSource pbds = (PushBufferDataSource)ds; PushBufferStream pbss = pbds.getStreams(); for(int i=0;ipbss.length;i+) try SendStream ss = mgr.createSendStream(ds, i); ss.start(); catch (UnsupportedFormatException | IOException e) e.printStackTrace(); p.start(); try Thread.sleep(60000);/传送一分钟后关闭 catch (InterruptedException e) e.printStackTrace(); if(p!=null) p.stop(); p.close(); if(mgr!=null) mgr.removeTargets(client disconnnected); mgr.dispose(); mgr = null; private static void doSomeVideoProcess(Processor p,StateHelper sh) sh.configure(5000); p.setContentDescriptor(new ContentDescriptor(ContentDescriptor.RAW_RTP); setVideoTrackFormat(p.getTrackControls(); sh.realize(5000); setJPEGQuality(p, 0.5f); private static void doSomeAudioProcess(Processor p,StateHelper sh) sh.configure(5000); p.setContentDescriptor(new ContentDescriptor(ContentDescriptor.RAW); setAudioTrackFormat(p.getTrackControls(); sh.realize(5000); private static Format checkForVideoSizes(Format original, Format supported) int width, height; Dimension size = (VideoFormat)original).getSize(); Format jpegFmt = new Format(VideoFormat.JPEG_RTP); Format h263Fmt = new Format(VideoFormat.H263_RTP); if (supported.matches(jpegFmt) / For JPEG, make sure width and height are divisible by 8. width = (size.width % 8 = 0 ? size.width : (int)(size.width / 8) * 8); height = (size.height % 8 = 0 ? size.height : (int)(size.height / 8) * 8); else if (supported.matches(h263Fmt) / For H.263, we o
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年互联网金融平台用户信任度提升与风险控制策略研究
- 住宅空置车位管理办法
- 企业服务专员管理办法
- 中职食堂饭菜管理办法
- 乡村土地使用管理办法
- 丰田售后维修管理办法
- 乡镇人员考核管理办法
- 休学创业学籍管理办法
- 临时生产工厂管理办法
- 企业安全预防管理办法
- “临床营养科建设与管理指南”实施细则-I级标准化临床营养科建设示范基地
- 科学活动《自制饮水机》
- 初步设计及概算评估咨询服务方案投标文件(技术方案)
- 急性中毒的治疗与护理
- 收益法评估企业价值操作指导意见试行
- 《teamLab无界美术馆(上海)的运营模式分析案例》7200字
- 尘肺病诊断试题及答案
- 眼科院感培训
- 2025年四川广安市前锋区广安鑫鸿集团有限公司招聘笔试参考题库附带答案详解
- 2025年中国体外培育牛黄行业发展监测及投资战略咨询报告
- 完整版肿瘤科医疗质量评价体系与考核标准
评论
0/150
提交评论