题目:Implement pow(x,n).代码:class Solution {public: double myPow(double x, int n) { double ret = Solution::positivePow(fabs(x), ...
分类:
其他好文 时间:
2015-05-29 13:27:57
阅读次数:
94
公式一:var Tween = { Linear: function(t, b, c, d) { return c * t / d + b; }, Quad: { easeIn: function(t, b, c, d) { ret...
分类:
Web程序 时间:
2015-05-28 15:44:29
阅读次数:
359
这周主要学习的是转移指令的相关知识和原理。offset在和汇编语言中是由编译器处理的符号,它的功能是取得标号的偏移地址。jmp是无条件转移指令,可以只修改IP,也可以同时修改CS和IP。CPU在执行jmp指令的时候不需要转移的目的地址,机器码中包含的的是转移的位移。Ret指令用栈中的数据,修改IP的...
分类:
其他好文 时间:
2015-05-28 00:11:38
阅读次数:
222
Typical recursion usage.class Solution { vector> ret; void dfs(vector curr, int currSum, int maxN, int n, int k) { // Ending ...
分类:
其他好文 时间:
2015-05-25 16:20:29
阅读次数:
136
public class Solution { public ListNode addTwoNumbers(ListNode l1, ListNode l2) { ListNode ret = new ListNode(0); ListNode cur = ret; ...
分类:
其他好文 时间:
2015-05-24 14:11:28
阅读次数:
110
#include typedef struct{ int i; int num; int state;} task;#define crBegin(state) \ switch (state) { case 0:#define crReturn(state, ret...
分类:
其他好文 时间:
2015-05-24 01:19:31
阅读次数:
129
iOS应?程序出现Crash(闪退),90%以上的原因是内存问题。在一个拥有数十个甚?至是上百个类的?程里,查找内存问题极其困难。了解内存常?问题,能帮我们减少出错几率。 内存问题体现在两个方面:内存溢出、野指针异常。 1、野指针异常内存管理的方式引用计数影响引用计数的方法有 +alloc -ret...
分类:
其他好文 时间:
2015-05-22 20:58:20
阅读次数:
157
//实现字符串操作函数strcpy
#include
#include
char *my_strcpy(char *dest, const char *src)
{
char *ret = dest;
assert((dest != NULL) && (src != NULL));//断言
if(dest == src)
return dest;
while(*dest++ = *sr...
分类:
编程语言 时间:
2015-05-22 13:30:33
阅读次数:
120
从右向左旋转数组,一共k次。k可以是任意数字。public class Solution { public void rotate(int[] nums, int k) { if(k == 0 || nums.length==0 || nums.length==1) ret...
分类:
其他好文 时间:
2015-05-22 00:12:59
阅读次数:
115
我在调用avformat_open_input的时候,一直返回-13错误,如下代码: const char *url = "/mnt/sdcard/xpg.mp4";
av_register_all();
AVFormatContext *pFormatCtx = NULL;
int ret = avformat_open...
分类:
其他好文 时间:
2015-05-20 11:31:43
阅读次数:
692