码迷,mamicode.com
首页 >  
搜索关键字:end    ( 30778个结果
通过WebViewJavascriptBridge实现OC与JS交互
这里照搬Github的Demo,其实还是很易懂的,首先,要在控制器的.h文件当中实现浏览器控件的协议:1 #import 2 3 @interface ExampleAppViewController : UINavigationController 4 5 @end在.m方法当中,WebViewJ...
分类:编程语言   时间:2014-06-15 23:00:33    阅读次数:248
初识算法
1.accumulate的用法:int sum = accumulate(ivec.begin(), ivec.end(), 0 );第三个参数时累加的初值,更重要的是accumulate对要累加元素的类型一无所知,所以容器内的类型要与第三个实参的类型匹配,或者可转换成第三个实参的类型。2.find...
分类:其他好文   时间:2014-06-15 22:42:19    阅读次数:285
topcoder SRM 624 DIV2 CostOfDancing
排个序,求前k个元素和即可 int minimum(int K, vector danceCost) { sort(danceCost.begin(),danceCost.end()); return accumulate(danceCost.begin()...
分类:其他好文   时间:2014-06-15 21:53:14    阅读次数:201
topcoder SRM 624 DIV2 BuildingHeightsEasy
从大到小遍历一遍,每次取M个元素,然后求得最小的floor即可 int minimum(int M, vector heights) { sort(heights.begin(),heights.end()); int minFloor = 10000; ...
分类:其他好文   时间:2014-06-15 21:48:45    阅读次数:229
剑指OFFER之数组中出现次数超过一半的数字(九度OJ1370)
题目描述:数组中有一个数字出现的次数超过数组长度的一半,请找出这个数字。例如输入一个长度为9的数组{1,2,3,2,2,2,5,4,2}。由于数字2在数组中出现了5次,超过数组长度的一半,因此输出2。输入:每个测试案例包括2行:第一行输入一个整数n(1= middle) end...
分类:其他好文   时间:2014-06-15 21:33:50    阅读次数:213
Android判断TextView是否超出加省略号
我们都知道通过指定android:ellipsize="end" android:singleLine="true" 可以让TextView自动截断超出部分并且添加省略号。但是如何判断一个TextView是否被截断了呢?这个问题在StackOverflow上有人讨论过,不过遗憾的是我测试出Layou...
分类:移动开发   时间:2014-06-14 23:24:44    阅读次数:618
[Leetcode] Binary Tree Maximum Path Sum
Question:Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, .....
分类:其他好文   时间:2014-06-14 20:59:07    阅读次数:188
ruby简单的基础 2
1、代码块代码块是用大括号或者do...end括起来的一系列代码。{ #this is a block}do #this is a blockend[1,2,3,4,5].each {|i| puts i}[1,2,3,4,5].each do |i|puts iend这2中写法效果是一样的,用{}可能更像C的风格2、作用域Ruby程序只会在3个地方关闭前一个作用域,同时打开一个新的作用域: 类定...
分类:其他好文   时间:2014-06-14 17:45:04    阅读次数:150
C++中计算程序运行的时间
首先定义clock_t start, end; 然后在自己要测试那段代码的前面加上start = clock(); 结尾加上end = clock(); 最后用输出语句进行  cout  cout...
分类:编程语言   时间:2014-06-14 12:11:28    阅读次数:205
Oracle学习(十一):PL/SQL
1.知识点:可以对照下面的录屏进行阅读 PL/SQL程序结构 declare 说明部分 (变量说明,光标申明,例外说明 〕 begin 语句序列 (DML语句〕… exception 例外处理语句 End; / ----------------------------------------------------------------...
分类:数据库   时间:2014-06-14 00:30:36    阅读次数:372
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!