现在位置: 首页 > dimmer发表的所有文章
  • 11月
  • 04日
综合 ⁄ 共 518字 评论关闭
一、     题目       给一个数组包含n个物体,有蓝色、红色和白色三种颜色,把他们分类并按照红、白、蓝的顺序排列,我们用0、1、2来表示红白蓝的颜色 注解:很容易想到遍历两遍数组得到三个数的数目,再覆盖,但是请只遍历一遍数组来解决。 二、     分析       很简单,题目的意思其实就是让对一个数组排序,数组中的元素只有0、1、2,并且要求只能遍历一遍数组,常数空间复杂度。此时我们可以想到借助于快速排序的partition思想,以1为中间枢纽对数组进行划分,使0在数组的左边,2在数组的右边,1在数组的中间。    class Sol......
阅读全文
  • 03月
  • 16日
综合 ⁄ 共 18108字 评论关闭
这是用RTP(RFC3350)按RFC2550封装MPEG ES流数据的发送程序。学习RTP的路真的辛苦。在网上收集的有关RTP的程序都是那种只负责RTP数据包发送的库,如jrtplib等,他们的DEMO 程序都只是用来发发字符串,编编聊天程序,无论是国内还是国外,都没有结合真正的应用的DEMO。其实我的目的很简单,就是写发个视频流服务器,不用复杂,只用把基本原理弄懂,因为这样你才能有的放矢。与网上和RTP相关的库没有应用不一让,当你尝试以流媒体服务器、linux来baidu或 google时,你搜出来完非就那么几类: 1.FFSERVER      FFMPEG2的DEMO,说它有......
阅读全文
  • 02月
  • 06日
综合 ⁄ 共 1561字 评论关闭
Optional: Creating a Clean Slate The following steps remove some Interface Builder odds and ends from the project; this is optional, but it’s something I like to do to start from a clean slate. 1. Interface Builder uses an XML file called a xib for defining an object graph of UI elements. Since you’re creating a pure OpenGL application, you don’t need this file in your project. In the Groups & Files pane on the left, find the folder that says Resources (or something similar such as Re......
阅读全文
  • 12月
  • 27日
综合 ⁄ 共 1175字 评论关闭
---推荐链接: 正则表达式30分钟入门教程: https://deerchao.net/tutorials/regex/regex.htm  正则表达式语法:http://www.cnblogs.com/yasin/archive/2009/07/20/1527013.html  http://dragon.cnblogs.com/archive/2006/05/08/394078.html  js-w3c正则表达式: http://www.w3school.com.cn/js/jsref_obj_regexp.asp  js正则表达式:http://www.cnblogs.com/rubylouvre/archive/2010/03/09/1681222.html  java正则表达式: http://www.cnblogs.com/lonelysharer/archive/2012/03/08/2384773.html  http://www.cnblogs.com/Lowp/ar......
阅读全文
  • 12月
  • 22日
综合 ⁄ 共 451字 评论关闭
以root用户登录之后,在终端执行 sudo ps -e |grep ssh 如果显示内容只有 root@ubuntu:/etc/apt# sudo ps -e |grep ssh  2127 ? 00:00:00 ssh-agent 说明只有agent没有server,需要安装server: sudo apt-get update 然后执行 sudo apt-get install openssh-server sudo ps -e |grep ssh 显示 root@ubuntu:/etc/apt# sudo ps -e |grep ssh  2127 ? 00:00:00 ssh-agent  4547 ? 00:00:00 sshd 证明安装成功 执行 sudo gedit /etc/ssh/sshd_config 修改PermitRootLogin without-password为 #PermitRootLogin without-password Perm......
阅读全文
  • 12月
  • 13日
综合 ⁄ 共 1146字 评论关闭
题意:有F种食物 D种饮料 它们都有一定的数量 有N个人 每个人都有自己喜欢吃的食物和饮料 (每个人至少要一种食物和饮料) 只有能满足他的要求时他才会接服务 求最大能满足多少人? 思路:网络流 建一超级源点 汇点 源点与食物相连 边权为其数量,汇点与饮料相连 边权也为其数量 把人分成两个点 之间的边权为1 每个人与之需要的食物和饮料相连 边权为1  ////125MS    2136K #include <stdio.h> #include <string.h> #define VM    1000 #define EM    200000 #define inf 0x3f3f3f3f struct E {     int to,cap,n......
阅读全文
  • 12月
  • 09日
综合 ⁄ 共 325字 评论关闭
假设定义了一个UITableView *myTableView; sectionIndex为row所在的Section,rowIndex及row所在行 UITableViewCell *cell = [myTableView cellForRowAtIndexPath:[NSIndexParh indexPathForRow:rowIndex inSection:sectionIndex]; 那么对于获取cell上的controller; 则可以采用 id controller = [cell viewWithTag:tag]; 可以先设置好controller 的tag即可; 当然如果controller为cell 的 property,直接采用点操作了 eg:cell.title;
阅读全文
  • 11月
  • 13日
综合 ⁄ 共 7463字 评论关闭
文章目录 本文转载至:https://developer.bluetooth.org/TechnologyOverview/Pages/Profiles.aspx 另可参考:http://zh.wikipedia.org/wiki/%E8%97%8D%E7%89%99%E8%A6%8F%E7%AF%84 To use Bluetooth® wireless technology, a device must be able to interpret certain Bluetooth profiles. Bluetooth profiles are definitions of possible applications and specify general behaviors that Bluetooth enabled devices use to communicate with other Bluetooth dev......
阅读全文
  • 10月
  • 15日
综合 ⁄ 共 3138字 评论关闭
Network of Schools Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 10726 Accepted: 4271 Description A number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools to which it distributes software (the “receiving schools”). Note that if B is in the distribution list of school A, then A does not necessarily appear in the list of school B You are to write a program ......
阅读全文
  • 10月
  • 10日
综合 ⁄ 共 1823字 评论关闭
1.UIViewContrller之间的切换有三种方式:     一、UIViewController自身之间的调用:[self presentModalViewController:UIViewController animated:YES]; 对应的返回操作函数:[self dismissModalViewControllerAnimated:YES];这里的self代表的是UIViewController自己。    其可设置四种动画模式: [java] view plaincopyprint? case 0:   [ctrl setModalTransitionStyle:UIModalTransitionStyleCoverVertical]; //底部向上 默认的动画方式   break;   case 1:   [ctrl setModalTransitionStyle:UIModalTransition......
阅读全文
  • 01月
  • 16日
综合 ⁄ 共 498字 评论关闭
window.attachEvent("onload", init); function init(){     var classElements = [];     classElements = document.getElementsByTagName('a');     for (var i = 0; i < classElements.length; i++) {     var url=classElements[i].href;     var strAddr;        if (url.toString().toLowerCase().search('dotnetdll=registration')!=-1) {         if(url.toString().toLowerCase().search('dotnetfunc=runtraindatapage')!=-1){         strAddr =url.toString();         var strURL = strAddr + '&J=trainingpla......
阅读全文
  • 12月
  • 17日
综合 ⁄ 共 891字 评论关闭
  1、年年乞与人间巧,不道人间巧已多。——杨璞《七夕》   2、天阶夜色凉如水,坐看牵牛织女星。——杜牧《秋夕》   3、家人竟喜开妆镜,月下穿针拜九宵。——权德舆《七夕》   4、此日六军同驻马,当时七夕笑牵牛。——李商隐《马嵬其二》   5、别离还有经年客,怅望不如河鼓星。——徐凝《七夕》   6、桑蚕不作茧,尽夜长悬丝。——《七夕夜女歌》   7、风雨七夕计已久,炎凉人事亦非鲜。——啸之《风雨七夕夜》   8、铜壶漏报天将晓,惆怅佳期又一年。——罗隐《七夕》   9、当日佳期鹊误传,至今犹作断肠仙。——晏几道《七夕......
阅读全文