STL 中取第 n 小数的算法 nth_element 的函数原型如下
template
void nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last);
算法说明:
1、功能:执行 nth_element 后,nth 所指位置的元素将是整个区间有序时在该处的元素。对 [first, nth) 中的任意迭代器 i 和 [n...
分类:
其他好文 时间:
2014-07-22 23:03:14
阅读次数:
345
ComboBoxPropertyDescriptor
1、public void setPropertyValue(Object id, Object value)
value为ComboBox中值的序号,而不是ComboBox中显示的名字.
2、public Object getPropertyValue(Object id)
返回的是序号需要转换为Integer类型。否则可能不显示可...
分类:
其他好文 时间:
2014-05-01 22:02:53
阅读次数:
387
.h
RichText* _richText;
void touchEvent(Ref *pSender, TouchEventType type);...
分类:
其他好文 时间:
2014-05-01 18:18:40
阅读次数:
522
.h添加如下代码:
void pageViewEvent(Ref *pSender, PageViewEventType type);...
分类:
其他好文 时间:
2014-04-30 22:31:39
阅读次数:
405
代码如下
#include
#include
#include
using namespace std;
template
class Base
{
public:
Base(T name);
virtual void toString();
protected:
T id;
};
template
Base::Base(T n)
{
printf("B...
分类:
编程语言 时间:
2014-04-30 22:27:39
阅读次数:
450
android发送短信截获上一条发送是否成功,然后再来发送下一条短信
1.问题:在项目中遇到如下要求:代发短信有N条,实现一条一条的发送并在上一条短信发送成功之后再来发送下一条。
for(int i=0;i
sendSMS(10086, text1, i);
}
private void sendSMS(String toAddress, String body, Lon...
分类:
移动开发 时间:
2014-04-30 22:26:39
阅读次数:
368
冒泡排序
思路:就是每次将最大或最小的元素放到数组的最后,so easy!时间复杂度为(O(n^2))
public class BubbleSort {
public static void bubbleSort(int[] a) {
for (int j = 1; j < a.length; j++) {
for (int i = 0; i < a.length - j; i+...
分类:
编程语言 时间:
2014-04-30 22:12:40
阅读次数:
309
- (void)drawRect:(CGRect)rect
{
[super drawRect:rect];
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextSetRGBFillColor(ctx, .3, .3, .3, .1);
CGContextFillRect(ctx, self.boun...
分类:
其他好文 时间:
2014-04-29 13:33:22
阅读次数:
284
使用函数操作链表
1:计算链表中结点的个数:定义一个Length_list()函数用于计算链表中结点的个数
函数代码:
//计算链表中结点的个数
void Length_list(PNODE pHead)
{
PNODE p = pHead->pNext;
int len = 0;
while(NULL != p)
{
len++;
p = p->pNext;
...
分类:
其他好文 时间:
2014-04-29 13:28:21
阅读次数:
302
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LinqToEntity
{
class Program
{
static void Main(string[] args)
{
//...
分类:
其他好文 时间:
2014-04-29 13:16:21
阅读次数:
574