2018.4.3 19:00 ~ 2018.4.3 21:00
求回文子字符串数量
```python
import sys
def check(s):
length=len(s)
for i in range(length):
if s[i]!=s[length-1-i]:
return 0
return 1
s=sys.stdin.readline().strip()
res=0
try:
for i in range(len(s)):
for j in range(i+1,len(s)+1):
if check(继续阅读 »
This blog was sent to openstack-discuss mailing list originaly.
As the official Victoria release is approaching and it has been a long time
silence for Trove in the upstream, I think it's good time for me as the Trove
PTL for the last 3 dev cycles to have a project update. The things that will be
described below have 继续阅读 »
New features
Add --links, --linkdirs and --includedirs configure arguments
Add app2ipa plugin
Add dictionary syntax style for xmake.lua
Provide smart scanning and building mode without xmake.lua
Add set_xmakever api for xmake.lua
Add add_frameworks api for objc and swift
Support multi-languages extension and add golan继续阅读 »
Text Recognition
Fully Convolutional Recurrent Network for Handwritten Chinese Text Recognition paper
Deep LSTM Networks for Online Chinese Handwriting Recognition 2016 ICFHR
Convolution Multi-directional Recurrent Network for Offline Handwritten Text Recognition 2016 ICFHR
Sequence to Sequen继续阅读 »
Configuring a remote for a fork
List the current configured remote repository for your fork.
$git remote -v
origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)继续阅读 »
什么是Check
Check是C语言的一个单元测试框架。它提供一个小巧的单元测试接口。测试案例运行在各自独立的地址空间,所以断言失败和代码错误造成的段错误或者其他的信号可以被捕捉到。另外,测试的结果显示也兼容以下这些格式:Subunit、TAP、XML和通用的日志格式。
Check is a unit testing framework for C. It features a simple interface for defining unit tests, putting little in the way of the developer. Tests are run in a separate address space继续阅读 »
延迟绑定
Python闭包函数所引用的外部自由变量是延迟绑定的。
In [2]: def multipliers():
...: return [lambda x: i * x for i in range(4)]
In [3]: print [m(2) for m in multipliers()]
[6, 6, 6, 6]
如以上代码: i是闭包函数引用的外部作用域的自由变量, 只有在内部函数被调用的时候才会搜索变量i的值, 由于循环已结束, i指向最终值3, 所以各函数调用都得到了相同的结果。
解决方法:
1) 生成闭包函数的时候立即绑定(使用函数形参的默认值):
In [5]: def multip继续阅读 »
1. Pythonic Thinking
1.1 know which version of python you're using
two major python version;
multiple popular runtimes for python: cpython, jython, ironpython, pypy, etc;
be sure that the command line for running python on your system is the version you want;
prefer python 3 in your next project;继续阅读 »
Lucene英文目录结构和功能模块
- core: Lucene core library
- analyzers
analyzers-common: Analyzers for indexing content in different languages and domains.
analyzers-icu: Analysis integration with ICU (International Components for Unicode).
analyzers-kuromoji: Japanese Morphological Analyzer
analyzers-morfologik: Anal继续阅读 »