####Timeline Design Redis
# 用户发的Feed
user.$id.feeds = ZSET{
$timestamp : $feed_id,
$timestamp : $feed_id,
...
}
作者:变先生 链接: | |
https://zhuanlan.zhihu.com/p/29047119 | |
来源:知乎 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。 转载自他人公众号,与本人无任何关系,侵删。 | |
早晨,从窗外的亮光看,今天大约又是一个晴天。 | |
到了晴天,人的心情应该会好一些吧。 |
if application "网易云音乐" is running then | |
tell application "System Events" | |
tell process "NeteaseMusic" | |
if get title of menu item 1 of menu 1 of menu bar item "控制" of menu bar 1 = "播放" then | |
return "play" | |
else | |
return "pause" | |
end if | |
end tell | |
end tell |
[General] | |
loglevel = notify | |
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12,127.0.0.0/24,100.64.0.0/10 | |
bypass-tun = 0.0.0.0/8, 1.0.0.0/9, 1.160.0.0/11, 1.192.0.0/11, 10.0.0.0/8, 14.0.0.0/11, 14.96.0.0/11, 14.128.0.0/11, 14.192.0.0/11, 27.0.0.0/10, 27.96.0.0/11, 27.128.0.0/9, 36.0.0.0/10, 36.96.0.0/11, 36.128.0.0/9, 39.0.0.0/11, 39.64.0.0/10, 39.128.0.0/10, 42.0.0.0/8, 43.224.0.0/11, 45.64.0.0/10, 47.64.0.0/10, 49.0.0.0/9, 49.128.0.0/11, 49.192.0.0/10, 54.192.0.0/11, 58.0.0.0/9, 58.128.0.0/11, 58.192.0.0/10, 59.32.0.0/11, 59.64.0.0/10, 59.128.0.0/9, 60.0.0.0/10, 60.160.0.0/11, 60.192.0.0/10, 61.0.0.0/10, 61.64.0.0/11, 61.128.0.0/10, 61.224.0.0/11, 100.64.0.0/10, 101.0.0.0/9, 101.128.0.0/11, 101.192.0.0/10, 103.0.0.0/10, 103.192.0.0/10, 106.0.0.0/9, 106.224.0.0/11, 110.0.0.0/7, 112.0.0.0/9, 112.128.0.0/11, 112.192.0.0/10, 113.0.0.0/9, 113.128.0.0/11, 113.192.0.0/10, 114.0.0.0/9, 114.128.0.0/11, 114.192.0.0/10, 115.0.0.0/8, 116.0.0.0/8, 117.0.0.0/9, 117.128.0.0/10, 118.0.0.0/11, 118.64.0.0/10, 118.128.0.0 |
[General] | |
loglevel = notify | |
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12,127.0.0.0/24,100.64.0.0/10 | |
bypass-tun = 0.0.0.0/8, 1.0.0.0/9, 1.160.0.0/11, 1.192.0.0/11, 10.0.0.0/8, 14.0.0.0/11, 14.96.0.0/11, 14.128.0.0/11, 14.192.0.0/11, 27.0.0.0/10, 27.96.0.0/11, 27.128.0.0/9, 36.0.0.0/10, 36.96.0.0/11, 36.128.0.0/9, 39.0.0.0/11, 39.64.0.0/10, 39.128.0.0/10, 42.0.0.0/8, 43.224.0.0/11, 45.64.0.0/10, 47.64.0.0/10, 49.0.0.0/9, 49.128.0.0/11, 49.192.0.0/10, 54.192.0.0/11, 58.0.0.0/9, 58.128.0.0/11, 58.192.0.0/10, 59.32.0.0/11, 59.64.0.0/10, 59.128.0.0/9, 60.0.0.0/10, 60.160.0.0/11, 60.192.0.0/10, 61.0.0.0/10, 61.64.0.0/11, 61.128.0.0/10, 61.224.0.0/11, 100.64.0.0/10, 101.0.0.0/9, 101.128.0.0/11, 101.192.0.0/10, 103.0.0.0/10, 103.192.0.0/10, 106.0.0.0/9, 106.224.0.0/11, 110.0.0.0/7, 112.0.0.0/9, 112.128.0.0/11, 112.192.0.0/10, 113.0.0.0/9, 113.128.0.0/11, 113.192.0.0/10, 114.0.0.0/9, 114.128.0.0/11, 114.192.0.0/10, 115.0.0.0/8, 116.0.0.0/8, 117.0.0.0/9, 117.128.0.0/10, 118.0.0.0/11, 118.64.0.0/10, 118.128.0.0 |
<?php | |
if(!class_exists('Memcached')){ | |
die('class Memcached not found.'); | |
} | |
$mc = new Memcached(); | |
$mc->addServer('127.0.0.1', 11211); | |
if(!$mc){ | |
die('Memcached connection error.'); |
####Timeline Design Redis
# 用户发的Feed
user.$id.feeds = ZSET{
$timestamp : $feed_id,
$timestamp : $feed_id,
...
}
MongoDB的哲学:能交给客户端驱动程序来做的事情就不要交给服务器来做。这种理念背后的原因是,即便是像MongoDB这样扩展性非常好的数据库,扩展应用层也要比扩展数据库层容易得多。将工作交由客户端来处理,就减轻了数据库扩展的负担。
##文档定义
key
不能包含.
和$
,且key
区分大小写。_id
##集合定义
system.
##数据类型
# for project that already created, execute the command below after changing .gitignore file | |
# git rm -r --cached . | |
# git add . | |
######################### | |
# .gitignore file for Xcode4 and Xcode5 Source projects | |
# | |
# Apple bugs, waiting for Apple to fix/respond: | |
# |
#NSLayoutFormatOptions 翻译自:http://iosdevelopmentjournal.com/blog/2013/04/22/alignment-options-in-auto-laytout/
在constraintsWithVisualFormat:options:metrics:views:
函数中, options 参数是一个 bitmask,它指定了VFL中的元素如何对齐。举个例子,"V:[first][second][third]"
这一句VFL只告诉你了三个元素应该纵向堆叠在一起,但是没有说当它们宽度不同时该怎么办。
你可以再增加一些横向的 constraints,但是这些知识无聊的体力劳动。其实你可以传入一个 option,将它们的相对位置告诉排版引擎。