This post introduces how to use the JavaScript feature to implement the Java style inheritance.
分类:
编程语言 时间:
2014-07-22 22:53:56
阅读次数:
350
源地址:http://zihua.li/2014/06/implement-instagram-like-filters/滤镜对于照片而言,起到的是雪中送炭和锦上添花的作用。优秀的滤镜,能让随手之作显得别有风味,又能为已经绝色的照片画龙点睛。现在几乎凡是和照片相关的应用程序都有滤镜功能,而相较而言介...
分类:
其他好文 时间:
2014-07-21 11:23:48
阅读次数:
1519
Reference: http://blog.csdn.net/lbyxiafei/article/details/9375735题目:Implement int sqrt(int x).Compute and return the square root of x.题解: 这道题很巧妙的运用了二....
分类:
编程语言 时间:
2014-07-21 11:22:09
阅读次数:
293
Implement pow(x,n).题解:注意两点:普通的递归把n降为n-1会超时,要用二分的方法,每次把xn= x[n/2]* x[n/2] * xn-[n/2]*2, [n/2]表示n除以2下取整。n有可能取负数,负数的时候,先计算pow(x,-n),然后返回1/pow(x,-n);代码如下:...
分类:
其他好文 时间:
2014-07-21 09:35:26
阅读次数:
196
一.类与结构的示例比较: 结构示例: 1 public struct Person 2 { 3 string Name; 4 int height; 5 int weight 6 public bool overWeight() 7 { 8 //implement something ...
分类:
其他好文 时间:
2014-07-20 23:39:51
阅读次数:
317
最近看的关于网络爬虫和模拟登陆的资料,发现有这样一个包mechanize ['mek?.na?z]又称为机械化的意思,确实文如其意,确实有自动化的意思。mechanize.Browser and mechanize.UserAgentBase implement the interface of u...
分类:
其他好文 时间:
2014-07-20 10:13:11
阅读次数:
213
This post introduces how to implement the shallow and deep copy in JavaScript.
分类:
编程语言 时间:
2014-07-19 14:14:46
阅读次数:
194
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- Get the valu...
分类:
其他好文 时间:
2014-07-19 12:13:13
阅读次数:
254
android传感器的使用以加速度传感器、方向传感器、磁场、压力、温度、光感。特别的距离传感器为例介绍。首先所在的类需要implement SensorEventListener。使用传感器分为以下几步:1、新建一个SensorManager来管理传感器服务。代码为:SensorManager sm...
分类:
移动开发 时间:
2014-07-19 09:36:12
阅读次数:
310
Implement strStr().
Returns a pointer to the first occurrence of needle in haystack, or null if
needle is not part of haystack.
解题思路:
strstr()函数隶属标准库string.h头文件,其内部的实现是O(n^2)的时间复...
分类:
其他好文 时间:
2014-07-18 21:25:18
阅读次数:
328