CPS风格代码(C#版) using System; namespace fp { class CPS { static int add(int x, int y) => x + y; static int square(int x) => x * x; static int pythagoras(int x, int y) => add(square(x), square(y)); static void add_cps(int x, int y, Action<int>
CPS风格代码(Java 8版) package fp; import java.util.function.IntConsumer; public class CPS { static int add(int x, int y) {return x + y;} static int square(int x) {return x * x;} static int pythagoras(int x, int y){return add(square(x), square(y));} static
CPS风格代码(C++11版) #include <iostream> using namespace std; int add(int x, int y){return x + y;} int square(int x) {return x * x;} int pythagoras(int x, int y) {return add(square(x), square(y));} template<typename F> void add_cps(int x, int y, F
Sublime text代码补全插件(支持Javascript.JQuery.Bootstrap框架) 插件名称:javascript-API-Completions 支持Javascript.JQuery.Twitter Bootstrap框架.HTML5标签属性提示的插件,是少数支持sublime text 3的后缀提示的插件,HTML5标签提示sublime text 3自带,不过JQuery提示还是很有用处的,也可设置要提示的语言. 下载地址:https://github.com/P
今天总结一下在python中常用的一些风格代码,这些可能大家都会用,但有时可能也会忘记,在这里总结,工大家参考~~~ 先点赞在看,养成习惯~~~ 标题遍历一个范围内的数字 for i in xrange(6): print i ** 2 xrange会返回一个迭代器,用来一次一个值地遍历一个范围,这种方式比range更省内存.在python3中xrange已经改名为range. 遍历集合 colors = ['red', 'green', 'blue', 'yellow'] for color