摘要:
在学习haskell 记录以下常用的函数随时更新!spanspan:: (a ->Bool) -> [a] -> ([a], [a])span, applied to a predicatepand a listxs, returns a tuple where first element is longest prefix (possibly empty) ofxsof elements that satisfypand second element is the remainder of the list:接受一个 判断条件 和 一个 list xs, 返回一个包含两个l 阅读全文
摘要:
文档地址http://jinja.pocoo.org/docs/templates/#builtin-filtersindentindent(s, width=4, indentfirst=False)Return a copy of the passed string, each line indented by 4 spaces. The first line is not indented. If you want to change the number of spaces or indent the first line too you can pass additional par 阅读全文
摘要:
select to_char(date_published, 'yyyymm') yo from blog group by yo;转换成sqlalchemy 语句可以使用 extract()In[3]: year_field = db.func.extract('year', ArticleModel.date_published)In[4]: month_field = db.func.extract('month', ArticleModel.date_published)In[5]: yonth_field = year_field *1 阅读全文