一直以来对this的理解只在可以用,会用,却没有去深究其本质。这次,借着《JavaScript The Good Parts》,作了一次深刻的理解。下面我们一起来看看这个this吧。 在我们声明一个函数时,每个函数除了有定义时的parameters(形参),自身还会有额外的两个参数,一个是this....
分类:
编程语言 时间:
2014-10-13 23:57:37
阅读次数:
218
This is a very good linked list question, as there are tricky cases you have to consider, and getting them all right in one place is harder than it lo...
分类:
其他好文 时间:
2014-10-12 05:54:07
阅读次数:
161
main() { char s[30]; strcpy(s, "Good News!"); /*给数组赋字符串*/ . . . } 上面程序在编译时, 遇到char s[30]这条语句时, 编译程序会在内存的某处留 出连续30个字节的区域, 并将第一个字节的地址赋给s。当遇到strcpy( strc...
分类:
编程语言 时间:
2014-10-11 22:15:26
阅读次数:
202
Our good friend Mole is trying to code a big message. He is typing on an unusual keyboard with characters arranged in following way:
qwertyuiop
asdfghjkl;
zxcvbnm,./
Unfortunately Mole is blind, ...
分类:
其他好文 时间:
2014-10-10 02:36:33
阅读次数:
315
fundamentaltypes:IntDoubleFloatBoolStringcollectiontypes:ArrayDictionarydeclareconstantswith"let"declarevariableswith"var"withannotation(rarelyusedeg:leta:String="good";
varmsg:String="hello";
vara,b,c:Double;toshowaconstantorvariablewithprintln(followedbya..
分类:
移动开发 时间:
2014-10-10 01:51:14
阅读次数:
224
题目链接:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1120解题报告:dp,用一个串去更新另一个串,递推方程是:if(b[i] > a[j]) m = max(m,dp[j]); else if(b[i] == a[j]) dp[j...
分类:
其他好文 时间:
2014-10-09 18:09:08
阅读次数:
175
原题地址:https://oj.leetcode.com/problems/distinct-subsequences/题意:Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subseq...
分类:
编程语言 时间:
2014-10-08 00:56:04
阅读次数:
262
问题: Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return –321 Have you thought about this? Here are some good questi...
分类:
其他好文 时间:
2014-10-07 19:51:14
阅读次数:
154
题目链接:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1116解题报告:一个国家有n个城市,有m条路可以修,修每条路要一定的金币,现在这个国家只有K个金币,每个城市有一些人,要你求怎么修路使得总的费用在K的范围内,同时使得跟首都连接的城市的人口(...
分类:
其他好文 时间:
2014-10-07 18:29:43
阅读次数:
186
题目链接:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1113解题报告:输入两个字符串,第一个是原来的字典,第二个是新字典,字典中的元素的格式为一个关键字对应一个值,输入格式如下:{a:3,b:4,c:10,f:6}{a:3,c:5,d:10,e...
分类:
其他好文 时间:
2014-10-07 16:41:23
阅读次数:
251