var b:ByteArray = new ByteArray();
b.writeByte(1); b.writeByte(2); b.writeByte(3); b.writeByte(4); b.position = 0;
var c:uint = b.re...
分类:
其他好文 时间:
2014-05-23 22:13:13
阅读次数:
273
参考别人写得比较明白的,红色部分为重点吧:使用jQuery获取元素位置时,我们会使用position()或offset()方法,两个方法都返回一个包含两个属性的对象-左边距和上边距,它们两个的不同点在于位置的相对点不同。可以看看下边的图:从图中我们可以大体看出两者的区别。position()获取相对...
分类:
Web程序 时间:
2014-05-23 10:47:42
阅读次数:
306
题目大意:
超时进行促销,把账单放入一个箱子里
每次拿取数额最大的和最小的,给出 最大-最小 的钱。
问n天总共要给出多少钱。
思路分析:
multiset 上直接进行模拟
注意要使用long long
而且multiset的删除要用 迭代器。
#include
#include
#include
#include
#include
#define m...
分类:
其他好文 时间:
2014-05-23 08:11:38
阅读次数:
224
前面的一篇文章中简单的描述了一下内存映射的内容,http://blog.csdn.net/codectq/article/details/25658813,这篇文章作为用户把内存规划好之后,在用户空间使用IOCTL对设备进行控制时的常用函数的代码摘录。后续我会把这部分完善起来。
#ifdefCONFIG_MMU
externunsigned long __must_check __copy_f...
分类:
系统相关 时间:
2014-05-23 07:32:35
阅读次数:
424
首先分成一半2^17和2^18,并且把其中一半变成相反数,然后枚举一半二分查找另一半,在找到的位置前后也找找。
这里用到了二级排序,有很多细节要处理,不多说了。
巨坑的一个地方就是,不能用系统的abs,要自己手写,简直坑死。。
#include
#include
#include
#include
using namespace std;
typedef long long ...
分类:
其他好文 时间:
2014-05-22 12:01:31
阅读次数:
220
String sql="insert into t_testinfo (userId,main_food,vegetable,meat,method,mood,sport_amount,health_ill," +
"body_condition,fubu_condition,fubu_pain_position,fubu_pain_reason,fubu_pain_seriou...
分类:
数据库 时间:
2014-05-22 11:37:03
阅读次数:
525
3.3 数据类型
Java是强类型语言,必须为每一个变量声明一种类型。
3.3.1 整型
Java 提供四种整型
int 4字节
short 2字节
long 8字节
byte 1字节
长整型(long)数值有一个后缀L(例如40000000000L),十六进制数值有一个前缀0x(例如0xCAFE),八进制数值有一个前缀0(例如010)。
3.3.2 浮点型
J...
分类:
编程语言 时间:
2014-05-22 10:58:20
阅读次数:
348
【题目】
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
You may assume no duplicates in the array.
Here are few examples.
[1,3,5,6], 5 → 2
[1,3,5,6]...
分类:
其他好文 时间:
2014-05-22 09:41:59
阅读次数:
195
#include
#include
#include
#include
#include
using namespace std;
struct Library
{
long number;//编号
string bookname;//书名
string author;//作者
string press;//出版社
int price;//价格
}...
分类:
其他好文 时间:
2014-05-22 07:17:38
阅读次数:
206
【题目】
Given a sorted array of integers, find the starting and ending position of a given target value.
Your algorithm's runtime complexity must be in the order of O(log n).
If the target is not found in the array, return [-1, -1].
For example,
Given [5...
分类:
其他好文 时间:
2014-05-22 06:44:39
阅读次数:
265