2015-06-15 W.Y.
ES6
如何遍历一个数组的元素?在 20 年前,当 JavaScript 出现时,你也许会这样做: javascript for (var index = 0; index < myArray.length; index++) { console.log(myArray[index]); } 自从 ES5 开始,你可以使用内置的 forEach 方法: javascript myArray.forEach(function (value) { console.log(value); }); 代码更为精简,但有一个小缺点:不能使用 break 语句来跳出循环,也不能使用 return 语句来从闭包函数中返回。 如果有 for 继续阅读 »
2018-07-24 Lingxian Kong
k8s-keystone-auth service is used for Kubernetes webhook authentication and authorization for OpenStack Keystone. The k8s-keystone-auth service can be running either as a static pod(controlled by kubelet) or a normal kubernetes service. 继续阅读 »
2015-12-28 veryyoung
Docker An open platform for distributed applications for developers and sysadmins 给开发人员和系统管理员提供的分布式应用开放平台。 继续阅读 »
2016-07-18 ruki
xmake在xmake.lua中提供了 $(varname) 的语法,来支持内置变量的获取,例如: lua add_cxflags("-I$(buildir)") 它将会在在实际编译的时候,将内置的 buildir 变量转换为实际的构建输出目录:-I./build 并且这些变量在自定义脚本中,也是可以支持的,例如: lua target("test") after_build(target) print("build ok for $(plat)!") end 这将会在编译完后,输出: lua build ok for macosx! 这些内置变量,大部分都是通过配置的时候,缓存的 继续阅读 »
2016-02-25 ruki
New features Add smallest configure option Add process operation interfaces Changes Improve envirnoment interfaces Modify xmake.lua for supporting xmake v2.x Bugs fixed Fix ltimer bug Fix asio memory leaks bug Fix asio httpd response bug on linux Fix path bug for windows 继续阅读 »
2018-07-10 litaotao
1. Things Happen for A Reason 我最喜欢的一部电影《危情谍战》中有这样一句台词,“Things Happen for A Reason”,不知道为什么,直到今天我对这句台词的印象都很深刻,也许是当时看到这句话的时候脑海里灵光一现,或是引起共鸣才会烙下这么深刻的印象吧。几乎从那以后,不论是做事还是进行思考,我都会自然而然的养成从底层逻辑逐步的来挖掘和分析事物的核心原理。 继续阅读 »
2016-02-05 ruki
New features Add automaticlly check libc interfaces Support custom allocator Add trace for allocator in the debug mode Add static_pool module Add stream interfaces for reading all data to string Add adler32 hash algorithm Add tb_memmem interface Add regex module with pcre, pcre2 or posix regex Changes Optimize stre 继续阅读 »
2016-11-24 demon7452
Creature Mod Tutorial 1 - "Creating a Mod" In this tutorial we're going to learn how to create our very own mod for 'Don't Starve'. Mods are a way for players to add their own content to the game. Creating a mod is really easy. All we need is two files and a folder and we're good to go. Let's get started! 继续阅读 »
2016-06-26 ruki
Typically, you only need to execute the following command for compiling project. bash xmake xmake will probe your host environment and target platform automaticly. The default mode is release and xmake will compile all targets. You can compile only one given target which name is 'test' for executing the follo 继续阅读 »
2015-03-17 litaotao
1. 枚举 - enumerate 可以有参数哦 之前我们这样操作: i = 0 for item in iterable: print i, item i += 1 现在我们这样操作: for i, item in enumerate(iterable): print i, item enumerate函数还可以接收第二个参数。就像下面这样: list(enumerate('abc')) [(0, 'a'), (1, 'b'), (2, 'c')] list(enumerate('abc', 1)) [(1, 'a'), (2, 'b'), (3, 'c' 继续阅读 »