Khaleesi你肿么了!
盯这个照片5秒钟才反应出来这是谁。。。。
Posted
archive
This blog is rated 🔞, viewer discretion is advised
盯这个照片5秒钟才反应出来这是谁。。。。
Posted
archive
施华洛世奇(Swarovski)实际上有两种含义,很多情况下这两种含义容易被混同。首先他是世界首屈一指的水晶制造商和水晶奢侈品生产商,两百年来,施华洛世奇一直独享和水晶切割有关的所有技术,并以此作为最高色商业秘密。由于其垄断地位和巨大名声,施华洛世奇在很多情况下已经成为水晶的代名词。而第二种含义,则是所谓的施华洛世奇元素(Swarovski Elements),实际上,这代表的是这种产品制造中使用到人造水晶,而这很可能和真正的施华洛世奇毫无关系。
又想起了 美素丽儿 美素佳儿,康师傅,康帅傅 了。
我日真坑爹。
Posted
archive
Posted
archive
Don't use OAuth 2 for "Google Apps for Business", coz admin may set share option to "limit to xxx domain only", thus your poor nigga API account like "30000000000@developer.gserviceaccount.com" won't work.
Google Spreadsheets' CSV output format is terrible shit. Never bother touch it. It does not handle line breaks nor escapes like sane people do
XML-like namespace or XLST transformations is ruining JSON. Namespace everywhere, dict-inside-array is the norm which is a huge pain in the ass to parse.
In Spreadsheet API, use /lists/ instead of /cells/
The difference between /basic and /full projections is confusing. You should really use /values for read-only access
Never ever use OAuth2 Web service, it will ask for "whitelist" the callback URLs, if you are dev in intranet like 10.x.x.x and your IP address is DHCP dynamic, you are fucked to re-permit the callback URL.
The list feed contains all rows after the first row up to the first blank row. I mean, srsly WTF?
Posted
archive
OS X的蛋痛特性是 `launched
。如果你需要修改sshd的监听端口,那么
编辑 /System/Library/LaunchDaemons/ssh.plist
<key>Listeners</key>
<dict>
<key>SockServiceName</key>
<string>ssh-alt</string>
</dict>
然后在/etc/services
里定义:
ssh-alt 12345/tcp # ssh-alt
然后重启sshd服务:
sudo launchctl uload /System/Library/LaunchDaemons/ssh.plist
sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist
蛋碎!
Posted
archive
开篇帖子侃一下HAProxy这个神器有什么神器之处。
写过proxy的人都会写类似的语句:
localstream.write(upstream.read(1024))
upstream.write(localstream.read(1024))
其中1024为业界良心艹榴网的chunk或者一个buffer size。这样的操作在各种router, proxy, firewall 里太常见了。
那么HAProxy有什么特别的地方呢?秘密就是,上游socket的接受buffer和本地socket的发送buffer为同一块内存。也就是说,上游socket数据来了,本地socket自动发送这一块buffer的数据。效率真是高爆了。这块buffer数据还可以用内核调用splice()
和 tee()
来达到分流和分离信号的目的。
btw sendfile() 是不行的,源必须是可以mmap的buffer,目标必须是个socket。
那么弱爆了的python可否跪舔这种高级特性呢?2.7和3.X里是可以的,因为现在PEP 3118统一了各种streaming object 的buffer protocol。只需要用一个叫memoryview的引用
就可以实现共享buffer而达到zero-copy的目的了。
C API见这里,python代码例子在这里,具体核心调用就是 file.readinto()
和 socket.recv_into()
方法。具体代码留作读者课后练习。
Posted
archive
两个事情需要喷一下:
G+团队的官方博客:http://gplusproject.appspot.com/new-apps-iphone-android 这是个什么jb飞机玩意?为啥不用blogger?
看这个关于代码测试的google官方博客 http://googletesting.blogspot.sg/2013/03/testing-on-toilet-testing-state-vs.html 用它妈这么多javascript特效干嘛?关键是——禁用了js之后,页面就一片空白了。
欢迎来到后web 2.0时代——没有首页,没有订阅,没有js就神马都不显示的web app时代。
Posted
archive
day -3 observed performance downgrade when x-linking sites
day -2 frustrated at tcp blackout
day -1 punched the hole and see the light
day 0 productivity.
Posted
archive
It was fun while it lasted.
FUCK GOOG
Posted
archive
【Unix Socket 点滴 1】使用unix socket时,把路径名的第一个字节设为null byte(\x00),这样就不会产生实际的文件,使用起了比较方便,也不用纠结选哪个路径,随便一个字符串就行了。netstat的时候会发现,第一个字节变成了蜗牛符号
【Unix Socket 点滴 2】unix socket的DGRAM模式可以传输大数据块,而UDP单个包最大65507字节。
【Unix Socket 点滴 3】unix socket可以发送文件句柄。特别是大数据量交互的时候可以放在tmpfs共享内存,只把文件句柄发送过去,这样可以做到0-copy。
【Unix Socket 点滴 4】unix socket可以校验对端的uid和pid,这在某些场合下是一种可依赖的鉴权手段。
【Unix Socket 点滴 5】uninx DGRAM句柄在对端关闭时,会自动解除连接关系,端口变成unconnect状态,后续使用可以重新connect。
来自 CodeBox-腾讯 腾讯云平台资深还是浅就那么回事儿工程师。
第一点和第三点很重要~
Posted
archive
今天瞄了下Mozilla Circus这个项目,黑有意思。
简单的说,目前Web服务器基本模型都是一个总瓢把子Nginx,后边一大堆苦力worker进程。比如Python世界的Gunicorn是这个样子的粗暴简单:
worker基本都是日出而耕,日落而息。(顺便一喷,Supervisord这些都弱爆了。djb大牛的runit才是王道)
要做到聪明的运维,和可小可大硬又黑的HA scaling,就需要一个高级一点的worker进程管理器于是——哐当当,Mozilla的Circus闪亮登场!
中文介绍在这里Mongrel2&Circul = web栈的完全控制
我觉得这项目很不错,至少有了Web Console码农不用再去砸400多元的机械键盘去 kill -HUP
和 cat pidfile
啪啪啪了
但是Circus只这样就太大材小用了。都进程了,那么socket、fd也一并托管了吧。以后业务逻辑就只管去轮fd就是了。这就是einhorn项目的思路。
同时我突然觉得Mongrel2这个项目有点2,居然是用json把http完整序列化一遍再pubsub分发到处理点。。。。这效率。。
Circus的让我想起uWSGI。大部分核心特性都是重合的。uWSGI 1.3其实也支持Circus直接绑定fd了。uWSGI甚至支持adaptive process spawning,连Heroku那种手动设定worker数量的机制都弱爆了么。。
uWSGI是个好坑,我以前准备详细写写的。uWSGI还有一种绝世内功——统一、灵巧的signal机制达到集群能力。
所以这个uWSGI、circus的轮子核心还得看这个控制信道和数据信道的设计是否良好分离。uWSGI还提供了一些奇技淫巧,比如类似Redis/Memcache的in-process key-value store,跨语言的RPC机制,一个timer和cron。(随便喷:只能master进程启动的时候初始化timer和cron。。。wtf?)
再进一步思考:客户端海量请求的合理分离,这只是水平切割,那么垂直切割呢?比如,在两个地方的服务器集群,同时渲染部分模板,然后通过circus输出为最终版本……当然这个太YY了。
这些都是Circus有希望解决的。
看到这里,我突然想起了一个老物——inetd
历史真的是个轮回
Posted
archive
found this gem
While it is indeed now possible to utilize greenlets to convert multiple function calls into yields in a generator, it's still something you would not do.
In general JSON via HTTP or zeromq is so much cooler and more flexible than WSGI could ever be.
Gevent is much better
Posted
archive
坚持不懈在悬崖上依然勇于奉献无私给奶的好奶爸!在最后关键60秒获得了关键胜利!
Posted
archive
suppose you have url like this:
/api/<method>
In function based view it's like:
def myview(req, method=''):
if method=='callA':
return ""
elif method=='callB':
return ""
else:
return ""
The problem is you can't enumerate every callA and callB.
But for class based view it's trivial to write more elegant code like:
class myview(ViewRouter):
def callA(req):
return ''
def callB(req):
return ''
def default(req):
return ''
Just want to put up an example of what class-based views are useful in Web development. The powerful object introspection allows you to map URL behaviors to a well defined class.
Posted
archive
今天刷了下第三方ROM,我擦,搜狗的两个渣app删不掉,用RE浏览器删掉了。。。
结果。。。尼玛android的默认浏览器选项给屏蔽了。启动默认首页,弄死都是作者lishuo0427的JB烂博客
找到了个办法刷回官方包了。坑爹啊。我草!
Posted
archive
最近粗浅把玩了一下libev,感受颇深
首先是瞻仰了libuv python binding - pyuv 作者 @saghul 的博客
特别是这个slides很是学习了点东西
里边还提到,Twisted, Tornade和Gevent都有其对应libuv实现了。猛啊。
其中一个重要的东西,就是 Python 3.3里边的PEP-3156,和其参考实现Tulip,基于Pyuv的也有个实现叫Rose。
可以大胆估计,PEP 3156是以后最重要的Python标准接口之一了。其重要性超过PEP 333 WSGI
libuv和 Boost.ASIO的比较看这里:
libuv Boost
Event Loop: yes Asio
Threadpool: yes Asio + Threads
Threading:
Threads: yes Threads
Synchronization: yes Threads
File System Operations:
Synchronous: yes FileSystem
Asynchronous: yes Asio + Filesystem
Timers: yes Asio
Scatter/Gather I/O[1]: no Asio
Networking:
ICMP: no Asio
DNS Resolution: async-only Asio
SSL: no Asio
TCP: async-only Asio
UDP: async-only Asio
Signal:
Handling: yes Asio
Sending: yes no
IPC:
UNIX Domain Sockets: yes Asio
Windows Named Pipe: yes Asio
Process Management:
Detaching: yes Process[2]
I/O Pipe: yes Process[2]
Spawning: yes Process[2]
System Queries:
CPU: yes no
Network Interface: yes no
TTY: yes no
Shared Library Loading: yes Extension[3]
Python 3.3还支持socket.sendmsg() 和 socket.recvmsg() ,这是两个碉堡了的Vector IO (Scatter/Gather I/O) 函数。POSIX里边writev() 和 readv() 这两个 都是基于他们实现。sendmsg() 还有个非常诡异的功能
On some systems, sendmsg() and recvmsg() can be used to pass file descriptors between processes over an AF_UNIX socket
这个其实可以用来轻松实现跨进程 IPC 机制。系统原生支持。
是不是 mpi4py 可以去死了呢?
python 3.3还支持 concurrent.futures ,自带virtualenv,yield.from,dict共享内存,支持lzma/xz等等好玩的特性。
其中Unicode改进:
ASCII字符占用1个字节,BMP范围(也就包括了CJK文字)占用2字节,其他Unicode占用4字节。。碉堡了!
作为一个Python 2.7忠实用户,有点动心了!
Posted
archive
com.yinyuetai.ui
这个JB设计居然只能竖屏。我擦。com.tencent.qqmusic
居然也是强制竖屏。在1080p电视上感谢这两款软件治好了我多年的颈椎病。com.tencent.qqmusicpad
还是很赞的。对于交互我的一些粗浅看法:
也就是说,桌面或者home screen放一排图标绝对是sb设计。这种老太太穿针的设计真的不适合大屏。最好的设计应该是类似iTunes cover flow那样的,简单一维的。传统遥控板就是两个一维:音量 和 频道。
其次大屏互动必须限制变化的部分,传统桌面到处都可以单击 双击 长按/右击,电视是不能有“焦点”这个sb设计的。电视的UI应该是更加人性化的“可以线性运动的控制部分”
Posted
archive
1.py:
def foo():
try:
return 'foo'
finally:
return 'bar'
print foo()
2.py
def foo():
try:
return 'foo'
finally:
print 'bar'
print foo()
The result is shocking...
$ python 1.py
bar
$ python 2.py
bar
foo
I think this particular behavior is well abused in WSGI
two cents:
return
does not actually leave the function immediatelyreturn
statement returns None, but explicitly return None is not the same. None
is the most abused thing in all programming languages.to quote the official doc:
When return passes control out of a try statement with a finally clause, that finally clause is executed before really leaving the function.
In a generator function, the return statement is not allowed to include an expression_list. In that context, a bare return indicates that the generator is done and will cause StopIteration to be raised.
As to yield
:
As of Python version 2.5, the yield statement is now allowed in the try clause of a try ... finally construct. If the generator is not resumed before it is finalized (by reaching a zero reference count or by being garbage collected), the generator-iterator’s close() method will be called, allowing any pending finally clauses to execute.
Black magic!
Posted
archive
摘录一下:
Posted
archive
我是不是out了现在才知道。。。
来源:
https://twitter.com/uponsnow/status/305585519822254080/photo/1
截图:
碉堡了!!!!!!!!
Posted
archive
从 HN 上看到这个视频
看到这个评论
One reason they don't already have cameras built in is a combination of power requirements
突然想到,一个由思轴组成的飞行swarm网络,如果每个节点都自带摄像头输入的话,网络可以p2p通信,那么这个swarm的战术能力比士兵组成的战术分队强大多少倍啊。。。。。
看来得加紧研制大功率激光近防武器了。这种小虫子势不可挡啊。
Posted
archive
看到这个报道
简单的说,由于twitter facebook被封了,PLA需要翻墙。用什么翻墙最方便呢?
当然是黑下来的肉鸡最方便。
Posted
archive
Reading this from Hacker News
The first thought is that the author had a brilliant idea, but after fighting with shellscript for a way and I found out that it’s totally not the case at all.
One word: UNIX Pipe is the golden hammer
Basically it’s the UNIX Pipe that allows you to connect inputs and outputs, it’s like the primitive Message Queue or Signal Framework used in many PaaS. It’s not bad, but it’s blatantly abused. If you think UNIX Pipes are easy then think harder. For example, a message duplexing with U
Posted
archive
VPS内存小,连uWSGI这种都玩不起,只能玩玩bjoern这个神器了。Bottle.py支持的WSGI容器还真多啊!
curl -O http://python-distribute.org/distribute_setup.py
sudo python distribute_setup.py
curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
sudo python get-pip.py
sudo emerge libev
CFLAGS=-I/usr/include/libev sudo pip install bjoern
灌了个水的哟。。。
Posted
archive
Problem:
I want ONE bottle project to display different pages for:
These should be separate Bottle apps.
There's an ugly hack from the official maillist, I think I can make it better.
The secret is to create a customized WSGI app:
from fnmatch import fnmatch
from bottle import Bottle, default_app, run
foo = Bottle()
foo.hostnames = ['foo.est.im']
@foo.route('/')
def hello():
return 'hello!'
bar = Bottle()
bar.hostnames = ['bar.est.im']
@bar.route('/')
def hi():
return 'hi~'
@route('/')
def index():
print 'hello world'
def application(environ, start_response):
for app in [foo, bar]:
hostnames = getattr(app, 'hostnames', [])
if filter(lambda x:fnmatch(hostname, x), hostnames):
return app(environ, start_response)
return default_app()(environ, start_response)
Then run this motherfucker:
from django.utils import autoreload
def dev_server():
run(application, host='0.0.0.0', port=8002, debug=True)
autoreload.main(dev_server)
Posted
archive
Google Docs自己搞了一套类似Google App Engine的体系,只不过服务器端语言是Javascript,运行环境是 云JS——Google Apps Script
https://developers.google.com/apps-script/html_service
看了下文档,类似php的语法,在html里嵌入js,然后服务器渲染得到一个网页。
= data[i][j]?> | } ?>
这是得有多蛋痛啊。那个结尾的<? } ?>
更是让人菊花一紧!
感脚Excel里边的VBA被秒杀了!
Posted
archive
via [1]http://www.reddit.com/r/math/comments/18i7zx/which_one_is_most_different_from_the_others/), 2
Posted
archive
Freedom. The fatuous jingle of our civilization
But only those deprived of it have the barest inkling
of what it really is
Posted
archive
I discovered Discourse on HN and played with it all day. So far it looks promising.
something I think yet to improve
Few rants about Stackoverflow. It's obvious that Jeff Atwood started this project by inspirations from Stackexchange sites, and I had some pretty bad experience recently, interesting topics are closed by hi-rep members for either it's off-topic or asked the question in the wrong way. This makes an active community dead. Hi-rep members should have some karma-recycle or reputation-TTL system to make sure they don't abuse their powers. Or they will corrupt as their momentum accumulates, they will transferring the state of the community to an irreversible way.
Also it's a pity that they chose Ruby on Rails over Python, I guess it's trending that Python going too enterprizy and RoR is more kind of "quick 'n dirty" in its nature.
Overall I am exited with Discourse, but still yet to see how it goes on
Posted
archive
形象生动
> Military ships and planes do not "lock onto other vessels all the time". Not with targeting radar, and not in international waters - doing so is proscribed under international law as an act of aggression. It is the high-tech equivalent of sticking a gun in someone's face and cocking the hammer
Posted
archive
请求:
POST https://www.googleapis.com/rpc HTTP/1.1
Host: www.googleapis.com
Connection: keep-alive
Content-Length: 159
Content-Type: application/json
{"method":"spelling.check","apiVersion":"v1","params":
{"text":"cchrome","language":"en","originCountry":"USA",
"key":"AIzaSyCLlKc60a3z7lo8deV-hAyDU7rHYgL4HZg"}}
返回:
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Date: Fri, 01 Feb 2013 07:01:26 GMT
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Content-Length: 209
Server: GSE
{
"result": {
"spellingCheckResponse": {
"misspellings": [
{
"charStart": 0,
"charLength": 7,
"suggestions": [
{
"suggestion": "chrome"
}
]
}
]
}
}
}
看来是没法利用了。shit。
更新:
似乎可以利用。那个API Key似乎又是可以用的
https://www.google.be/complete/search?sugexp=chrome,mod=17&client=chrome&hl=nl&q=about&sugkey=AIzaSyCLlKc60a3z7lo8deV-hAyDU7rHYgL4HZg
["about",["http:\/\/www.imdb.com\/title\/tt0276751\/","about cherry","about a boy"],["About a Boy (2002) - IMDb","",""],[],{"google:suggesttype":["NAVIGATION","QUERY","QUERY"],"google:suggestrelevance":[1200,600,551],"google:verbatimrelevance":1300}]
Google的各种黑科技真是多啊
Posted
archive
看到一则微博
@刘兴亮
HTML5的突出优点是多设备、跨平台。“HTML5 for TV”是由美国Cable Labs牵头组成的国际性开源协作项目,为推动HTML5技术在电视终端上的应用。预计2013年会有更多的开发者投入到基于智能电视的应用开发。针对大屏的应用开发是个“富矿”。2013年,智能电视终端应用的重要特点是——跨屏,跨终端互操作。
然后就跑去看了下他们的文档:
http://www.cablelabs.com/specifications/CL-SP-HTML5-MAP-I02-120510.pdf
觉得这个只是定制了一个节目厂商嵌入HTML的规范,然后他们的Tru2way®设备可以推送网页节目到电视。
这个只解决了一部分问题。首先限定了是线性内容,其次格式居然限定死是MPEG-2 TS。这个H.265的时代来看真的有点匪夷所思。
个人觉得最大的问题,是解决了HTML5 to TV,但是没有解决TV内嵌HTML5渲染引擎的问题。比如一个现实的问题:
vod.xunlei.com 我已经大部分视频在这里看了。但是
如果真正要推动标准发展和技术进步,HTML5应该支持
<video onControlPlay="function(){}" />
这样的DOM节点。
只是一些粗浅看法,可能并不完善。
Posted
archive
-----BEGIN CERTIFICATE-----
MIICszCCAhygAwIBAgIBAzANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQGEwJVUzET
MBEGA1UECAwKU29tZS1TdGF0ZTETMBEGA1UECgwKZ2l0aHViLmNvbTETMBEGA1UE
CwwKZ2l0aHViLmNvbTETMBEGA1UEAwwKZ2l0aHViLmNvbTAeFw0xMzAxMjUwNjI5
MTJaFw0xNDAxMjUwNjI5MTJaMGExCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApTb21l
LVN0YXRlMRMwEQYDVQQKDApnaXRodWIuY29tMRMwEQYDVQQLDApnaXRodWIuY29t
MRMwEQYDVQQDDApnaXRodWIuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB
gQDHp0HWucGPUs3Mawr23dJM5hLLX90VaTkV29WZTcXnfwGxWuGZvJUrKIcT5Sof
ujOqJXopEGbrsDMqYhTbcudsJKSmIHvD1wiIJTF+zgmTogk52CIWZ1coSxF3r3i5
1R4ZOjcNMIrNdKl3lN8mDUsYIhY3UiGHlXUaRLVyJ3XNYwIDAQABo3sweTAJBgNV
HRMEAjAAMCwGCWCGSAGG+EIBDQQfFh1PcGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZp
Y2F0ZTAdBgNVHQ4EFgQUuD0FAGWs6+V2cJzEZhDnMq+MTaswHwYDVR0jBBgwFoAU
KBU3wAzcCtFAf2aj5ZRAdbXnwpgwDQYJKoZIhvcNAQEFBQADgYEAkPy6u/FEezIz
ZHESozwidrcEsBSUd9pZC1voib/RpM4/KneJnY3PygOiLkPgjVq5+YephIpSwCOg
Nr0BFgZIwmra/0EWfL6CJb1wl8qJKShfWyv3en9FiZwhACbJf53TRzdq0zAi5s0H
dU/SlEQPUcNwE2HkLxNTCqU0xcwC7uo=
-----END CERTIFICATE-----
Posted
archive
suppose you have a django form
f = django.forms.Form()
f.is_valid()
f.data['field'] = 'new value' # won't work
f.cleaned_data['key'] = 'value' # won't work
the output of f.as_p()
is still the old value because the f.data
is a MergeDict.
The way to modify it:
d = dict(f.data, field='new value')
f.data = d
MergeDict is for pussies.
newdict = dict(mydict, key='new value')
is better than newdict = mydict.copy()
Posted
archive
http://www.google.com/dictionary/json?callback=dict_api.callbacks.id102&q=wtf&sl=en&tl=en&restrict=pr%2Cde%2Csy&client=te
https://www.google.com/dictionary/json?callback=dict_api.callbacks.id100&q=test&sl=en&tl=en&restrict=pr%2Cde%2Csy
妈的居然还有存活。
Posted
archive
从HN上看到过好多次 Datomic,但是今天才仔细看了下。
看不到Infoq视频的可以看这里中文 Datomic的架构
so far的一些观点:
仔细想了下,这个完美的大饼还是有很多弱点的。
比如CRA模式就不能很容易实现counter,比如类似reddit、HN那种多少人赞成/反对。
看到Datomic官方论坛里也承认了,aggregation的支持还是WIP。
但是如果Datomic做好了,那种演绎式查询还是可以做得非常强大的。比如可以按人群区分赞成/反对。传统rdbms做起来就麻烦了。
同时也想到了time series db的问题,Datomic做起来似乎也比较吃力。
乱写一点,继续看。这个入门文章看起来不错。
btw 自己挖坑轮ORM的一定要看这篇文章O/R impedance mismatch。精彩。Datomic号称解决了这个问题。
Posted
archive
1GL (First-generation programming language)
机器语言 —— 就是传说中小刀刻光盘那哥们儿去美国之后发明的
2GL:
3GL:
4GL:
虽然是一个过时的概念,还是拿出来玩一玩。
Posted
archive
一座300米高,拔地而起成jj状的山。。。。。。。。。。。。名字叫 Pico Cão Grande ,人称 大狗峰
São Tomé and Príncipe 圣多美这个国家在沙哈拉以南,非洲大陆西边的一个岛上。
Posted
archive
最近想做点Chrome方面的开发,发现太混乱了。整理一下逻辑吧:
Google Chrome
这个不仅是浏览器,而且是一整套生态系统体系
Google Chrome Extensions
大家常见的 “扩展” 体系
Hosted Apps
又叫 Installable Web Apps。本质还是网站,但是提供一些本地特性用来整合
文档: https://developers.google.com/chrome/apps/
主要特色就是:权限比普通网站更加开放,可以一次设定永久有效。支持manifest.json
。比如在里边通过background_page
指定一个网站URL作为后台运行的机制
Packaged Apps
又叫Chrome App
这就是可以看成exe或者dmg的东西了。本质是本地离线应用。
文档:http://developer.chrome.com/trunk/apps/
其中这一篇很核心:http://developer.chrome.com/trunk/apps/app_lifecycle.html
有比较严格的CSP安全机制和MVC开发体系。
支持很多和OS整合的特性,比如控制计算机硬件,双击本地文件,在Chrome里用指定的intent打开
支持Chrome Storage & Sync,也就是说数据、配置可以云漫游。(碉堡啦)
我非常郁闷,Packaged Apps不允许 background_page
,正在探索这是怎么一回事。
有一篇又臭又长的文章专门讲这个区别。注意这个文章有很多错误,加深了概念的混淆。囧。
Extensions, Packaged Apps, and Hosted Apps in the Chrome Web Store
我觉得Google正在建立一个新的walled garden。。。。上了贼船,就不容易下来了。
Posted
archive
看到这个新闻,震惊了!
猪脚是Verizon美国一位顶级资深码农,该公司为政府关键IT系统服务
我艹,真是天才。
附上Onion新闻一则:
Update: solidot和cnbeta都报道了。我out了
Posted
archive
看了这篇文章《螺旋发展的技术 》
觉得很有意思。以前我也喜欢喷技术的倒退啊之类的。现在看来不是这么回事。
我们理解的技术,只是现实技术 T 的绝对高度 |T| 在我们理想中的投影罢了 。一个技术的可见高度 = |T| * cos(心态) 。而技术的绝对高度的成长,则是不均衡发展的,非平衡的发展,造成的就是一种螺旋结构。
这是一种自然规律,但是是人为可控的。只是工业界太大不可能有一个中心指挥机制。
再也不愤了哈哈。
Posted
archive
网上的欢乐就多了好多~~
Posted
archive
看到这个很有趣啊
Analysis without numbers is only an opinion.
There is never a single right solution. There are always multiple wrong ones, though.
A bad design with a good presentation is doomed eventually. A good design with a bad presentation is doomed immediately. (PPT的重要性。。。)
(Larrabee's Law) Half of everything you hear in a classroom is crap. Education is figuring out which half is which.
from Akin's Laws of Spacecraft Design
Posted
archive
准确的说,为啥中文没有在计算机上发展出连笔字体?
Posted
archive
习惯了每天在网上喷来喷去,第一次见到Ms. Jane Elliott这么镇定而犀利的人。这种老师才是人类的灵魂工程师啊。。。。
看到中间的时候简直有点痛哭流涕的感觉,看到最后真的是被感动了
美国在1968年就由这样的老师和孩子。而现在不仅不可能有,而且可能永远没有了。
btw 一个纪录片
http://movie.douban.com/subject/3883396/
Posted
archive
Python声明
http://pyfound.blogspot.com/2013/01/wikipythonorg-compromised.html
Debian声明
http://lists.debian.org/debian-devel-announce/2013/01/msg00000.html
$ touch "exec __import__('base64').b64decode('cHJpbnQgImhlbGxvLCB3b3JsZCI=')"
$ tar cf result.py !$
tar cf result.py "exec __import__('base64').b64decode('cHJpbnQgImhlbGxvLCB3b3JsZCI=')"
$ python result.py
hello, world
$ tar xvf result.py
x exec __import__('base64').b64decode('cHJpbnQgImhlbGxvLCB3b3JsZCI=')
$
这个是0day的PoC。。。。
简单的说,就是一个上传,既是合法的tar文件,又是合法的python代码。omg碉堡了。
今天Ruby on Rails也被日了。
什么时候来日django?
Posted
archive
看这里:
http://www.engadget.com/2013/01/07/nvidia-i500-soft-modem/
SDR前面几篇博客也关注了。i500这个软modem性能应该不俗。就看RF前端的性能了。
有个老外评论:
Modems from High End RF chipset vendors are all soft modems. The limitation is the RF Front End. Unfortunately there are no PA's, LNA's, Duplexer, Diplexers, filters that can cover every damn band over there and hence the customization to a particular operator's frequencies. There are some Penta band devices out there that have multiple RF Chains because of the above limitations. Its not the modem that is the restriction. On top of this add the multi technologies with different bandwidths(LTE can go up to 20MHz, WCDMA 5MHz etc.) it is next to impossible to create a phone of today's size with these limitations that can work with every band.
我估计Tegra 4将替代RTL-SDR。成为新一代SDR神器。。。。
Posted
archive
http://i.vod.xunlei.com/req_history_play_list/req_num/30/req_offset/0?type=all&order=create&t=1356345404623
<type 'exceptions.UnicodeDecodeError'> at /req_history_play_list/req_num/30/req_offset/0
'utf8' codec can't decode byte 0xd7 in position 16: invalid continuation byte
Python /usr/local/lib/python2.7/json/encoder.py in iterencode, line 263
Web GET http://i.vod.xunlei.com/req_history_play_list/req_num/30/req_offset/0
Posted
archive
看到这个博客《搜狐微访谈:方舟子揭露微波炉烹饪致癌谣言》
方舟子跟网友互动啦, blah blah一大堆。。看到这个问答,笑喷了。
鹏赋Franklin: 向 @方舟子 提问: 用微波热中药怎么样?
方舟子: 用什么炉热中药都不怎么样。
trolling is a art
Posted
archive