Skip to content

Instantly share code, notes, and snippets.

{"sig":"8a2092a50aa15d221abff84ed2526cf0257579a3d1bee25273a2cadb4bd68caab83b7ed7eea94e194b0a81f3f28451cbbd3f270056cb3648fc0ff6c237ae029d1","msghash":"0e0a617bc829507090402bccb117147232e628ace89454c33aad9f38f2caeec0"}
@leafduo
leafduo / WWDC2016HD.txt
Created June 18, 2016 17:40
WWDC 2016 高清视频链接
http://devstreaming.apple.com/videos/wwdc/2016/228a1kbxogojm4fviqc/228/228_hd_a_peek_at_3d_touch.mp4
http://devstreaming.apple.com/videos/wwdc/2016/216v55u6zpxizxkml6k/216/216_hd_advances_in_uikit_animations_and_transitions.mp4
http://devstreaming.apple.com/videos/wwdc/2016/227a480gfx4hwinv5x9/227/227_hd_architecting_for_performance_on_watchos_3.mp4
http://devstreaming.apple.com/videos/wwdc/2016/235dk9q4a4mflq2dbms/235/235_hd_building_great_workout_apps.mp4
http://devstreaming.apple.com/videos/wwdc/2016/231bhrh1z1fzrejhbz7/231/231_hd_cloudkit_best_practices.mp4
http://devstreaming.apple.com/videos/wwdc/2016/239ebj00keggvd2m2fx/239/239_hd_crafting_modern_cocoa_apps.mp4
http://devstreaming.apple.com/videos/wwdc/2016/212s41rh77qgdg26s86/212/212_hd_developing_tvos_apps_using_tvmlkit_part_1.mp4
http://devstreaming.apple.com/videos/wwdc/2016/229b09xkrv3t6tdzwsu/229/229_hd_developing_tvos_apps_using_tvmlkit_part_2.mp4
http://devstreaming.apple.com/videos/wwdc/2016/230b83wfxc7m69dm90q/230/230_hd_enhancing_voip_apps_w
#!/bin/sh
set -e
RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
> "$RESOURCES_TO_COPY"
install_resource()
{
case $1 in
*.storyboard)
@leafduo
leafduo / zh_CN.yml
Last active December 21, 2015 18:49 — forked from soffes/en.yml
zh_CN:
viewer:
comment_on_twitter: '在 Twitter 上回复'
older: '旧文章'
newer: '新文章'
feed: 'Feed'
share: '分享'
close: '关闭'
next_post: '后一篇'
previous_post: '前一篇'

I guess I know what’s going on after a few trials. Toshl puts a validation rule which requires the name has at least 4 characters. Unfortunately, almost all Chinese have a name of 2 or 3 characters, like “张三”, which is not allowed in Toshl… (I guess some Japanese would suffer the same problem)

As an iOS developer, I also want to propose some suggestions:

  • Abandon the validation at all
  • Detect the language in use by using CFStringTokenizerCopyBestStringLanguage or some regular expression (don't preform validation on non-western names)
  • Detect the locale of the device by using NSLocale (not suggested because some Chinese are using non-Chinese locale)
  • Make the notice clearer by saying "your name is not long enough" instead of "please enter your name"
  • Read some articles about Chinese names…
path_list = ['user/moshin/a.py', 'user/moshin/b.py', 'user/haha.py', 'user/leafduo/hehe.py']
tree = {'user':[{'moshin':['a.py', 'b.py']}, 'haha.py', {'leafduo':['hehe.py']}]}
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/tornado-2.4-py2.6.egg/tornado/web.py", line 1042, in _execute
getattr(self, self.request.method.lower())(*args, **kwargs)
File "/home/tornado/web-secret-server/comment.py", line 92, in get
ret['total'] = self.db.query( "select count(1) as t from comments where status='publish' and article_id=%s"%aid )[0]["t"]
File "/usr/lib/python2.6/site-packages/tornado-2.4-py2.6.egg/tornado/database.py", line 120, in query
self._execute(cursor, query, parameters)
File "/usr/lib/python2.6/site-packages/tornado-2.4-py2.6.egg/tornado/database.py", line 208, in _execute
return cursor.execute(query, parameters)
File "/usr/lib64/python2.6/site-packages/MySQLdb/cursors.py", line 173, in execute
{
"created_at" : "Mon Mar 04 12:20:46 +0000 2013",
"id" : 308552596099051520,
"id_str" : "308552596099051523",
"text" : "@HondaJOJO 03-04 に入ってから 500 ポストに到達しました!(現在およそ 508 ポスト)",
"source" : "<a href=\"http://lbattery.dip.jp/twihaialert/\" rel=\"nofollow\">ツイ廃あらーと</a>",
"truncated" : false,
"in_reply_to_status_id" : null,
"in_reply_to_status_id_str" : null,
"in_reply_to_user_id" : 514378421,
{
"created_at" : "Sun Feb 24 10:59:39 +0000 2013",
"id" : 305633079865782272,
"id_str" : "305633079865782272",
"text" : "RT @StarKnight: 医生:平时你都用什么手段避孕?\n患者:我的外貌。\n#译自英语推",
"source" : "<a href=\"http://hotot.org\" rel=\"nofollow\">Hotot</a>",
"truncated" : false,
"in_reply_to_status_id" : null,
"in_reply_to_status_id_str" : null,
"in_reply_to_user_id" : null,
{
"created_at" : "Sun Feb 24 09:21:57 +0000 2013",
"id" : 305608492587315200,
"id_str" : "305608492587315200",
"text" : "RT @YuzukoAria: 妹妹的洞真小。",
"source" : "<a href=\"http://hotot.org\" rel=\"nofollow\">Hotot</a>",
"truncated" : false,
"in_reply_to_status_id" : null,
"in_reply_to_status_id_str" : null,
"in_reply_to_user_id" : null,