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-07-25 ruki
xmake can run and debug the given target program now. We only need configure the debug mode to compile this target and run it. e.g. ```lua -- enable debug symbols if is_mode("debug") set_symbols("debug") end -- define target target("demo") set_kind("kind") add_files("src/*.c") ``` And we compile and r 继续阅读 »
2017-06-12 MoreFreeze
vim
上一篇 CH13 Buffer-Local Abbreviations 这章就是说iabbrev也能用来修饰 你想记住某个新的snippet最好办法就是disable掉原来的命令,比如iabbrev return NOPENOPENOPE CH14 Autocommand Groups autocmd是不会替换原先的命令的,假如使用两次同样的命令,那触发autocmd时会进行两次命令 特别要注意在你source $MYVIMRC时,autocmd会再载入一次! 可以用augroup testgroup autocmd xxx augroup END,这时如果你运行下augroup testgroup autocmd yyy 继续阅读 »
2017-05-10 ruki
概述 此次更新,主要增强xmake lua插件,支持交互式命令执行(read-eval-print, REPL)以及一些稳定性问题修复。 有时候在交互模式下,运行命令更加的方便测试和验证一些模块和api,也更加的灵活,不需要再去额外写一个脚本文件来加载。 我们先看下,如何进入交互模式: ```bash 不带任何参数执行,就可以进入 $ xmake lua 进行表达式计算 1 + 2 3 赋值和打印变量值 a = 1 a 1 多行输入和执行 for _, v in pairs({1, 2, 3}) do print(v) end 1 2 3 ``` 继续阅读 »
2017-05-10 ruki
Introduction xmake lua has supported REPL(read-eval-print), we can write and test script more easily now. Enter interactive mode: ```bash $ xmake lua 1 + 2 3 a = 1 a 1 for _, v in pairs({1, 2, 3}) do print(v) end 1 2 3 ``` 继续阅读 »
2015-08-23 jude
about blocks methods can calll yield may times def many_yields yield(:peanut) yield(:butter) yield(:and) yield(:jelly) end 继续阅读 »
2017-09-20 Alex Sun
1. 模型选择 对于一组数据集,可能会选择不同的模型。例如: $$ \begin{array}{} h_\theta(x)=\theta_0+\theta_1x \ h_\theta(x)=\theta_0+\theta_1x+\theta_2x^2 \ h_\theta(x)=\theta_0+\theta_1x+...+\theta_3x^3 \ h_\theta(x)=\theta_0+\theta_1x+...+\theta_{10}x^{10} \ \end{array} $$ 继续阅读 »
2018-03-09 findneo
项目地址在 https://github.com/findneo/TKposts 人生活在社区里,对一个常使用微博的人来说,微博记录和反映了他在一段时间内所接触的信息,思考的问题和表达的观点,是值得研究的。如果这个研究对象是一个优秀的人,这里面的价值可能比想象要大。 很显然,要做成收集整理一个人所有的微博 这件事,首先是收集,其次是整理。 收集主要想到有三种方式: 找现成工具(无趣,暂不考虑)。 在https://m.weibo.cn/u/14015127xxx 页面一直按END 键,然后页面会不断异步发送请求以增加页面内容,直到全部内容都被获取。 可以看到第二种方法中的请求是向https://m.weibo.cn/ap 继续阅读 »
2017-03-14 blademainer
Linux 终端常用快捷键 more 移动光标 ctrl+b: 前移一个字符(backward) ctrl+f: 后移一个字符(forward) alt+b: 前移一个单词 alt+f: 后移一个单词 ctrl+a: 移到行首(a是首字母) ctrl+e: 移到行尾(end) ctrl+x: 行首到当前光标替换 继续阅读 »
2018-04-19 findneo
做了件无聊的事,做完发现有人做过了(https://www.v2ex.com/t/401615) ,记录一下。 GitHub用户名要求是 html Username may only contain alphanumeric characters or single hyphens, and cannot begin or end with a hyphen 也就是满足正则 ^[0-9a-zA-Z]$|[0-9a-zA-Z][-0-9a-zA-Z]*[0-9a-zA-Z] , 因为大小写不敏感,所以相当于 ^[0-9a-z]$|[0-9a-z][-0-9a-z]*[0-9a-z] 产生一位和两位的符合GitHub命名 继续阅读 »