This blog is rated  R⃣ , viewer discretion is advised

施华洛世奇元素 vs 施华洛世奇

施华洛世奇(Swarovski)实际上有两种含义,很多情况下这两种含义容易被混同。首先他是世界首屈一指的水晶制造商和水晶奢侈 …

Posted

archive

Google Spreadsheet API pitfalls

  1. 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.

  2. Google Spreadsheets' CSV output format is terrible shit. Never bother touch it. It does not handle …

Posted

archive

OS X Mountain Lion 修改 openssh sshd_config 配置

OS X的蛋痛特性是 `launched 。如果你需要修改sshd的监听端口,那么

编辑 /System/Library/LaunchDaemons/ssh.plist

        <key>Listeners</key>
        <dict>
                <key>SockServiceName</key>
                <string>ssh-alt</string>
        </dict>

然后在/etc/services里定义 …

Posted

archive

day -1

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

Unix Socket 点滴[转载]

【Unix Socket 点滴 1】使用unix socket时,把路径名的第一个字节设为null byte(\x00),这样就不会产生实际的文件,使用起了比较方便,也不用纠结 …

Posted

archive

yes, wsgi is such pain in the ass

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 …

Posted

archive

Benefits of class-based views

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 …

Posted

archive

再刷第三方ROM就剁手!

今天刷了下第三方ROM,我擦,搜狗的两个渣app删不掉,用RE浏览器删掉了。。。

结果。。。尼玛android的默认浏览器选项给屏蔽了。启动默认 …

Posted

archive

客厅android的一些感受

  1. com.yinyuetai.ui 这个JB设计居然只能竖屏。我擦。com.tencent.qqmusic 居然也是强制竖屏。在1080p电视上感谢这两款软件治好了我多年的颈椎病。
  2. com …

Posted

archive

Return twice in a python function

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 …

Posted

archive

pypy 10年黑历史——精彩回顾

摘录一下:

  • 2007年欧盟觉得pypy这货是典型的烂尾钓鱼工程于是就停止拨款了。
  • 尝试过RPython -> Javascript。失败告终
  • 至少4次用LLVM。全部失败 …

Posted

archive

Wat composable or contextual?

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 …

Posted

archive

Cloud Atlas 观后

Freedom. The fatuous jingle of our civilization

But only those deprived of it have the barest inkling
of what it really is

Posted

archive

Is Discourse going to be next Wordpress?

I discovered Discourse on HN and played with it all day. So far it looks promising.

  • freshing and distinctive UI
  • high profile blogger promotes it.
  • haz all the basic forum functions
  • community based moderation
  • deadly easy distribution and (promising) install methods.

something I think yet to improve

  • Does the system …

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 …

Posted

archive

Google Suggest spell checker

请求:

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 …

Posted

archive

HTML5 for TV (Big screen)

看到一则微博

@刘兴亮
HTML5的突出优点是多设备、跨平台。“HTML5 for TV”是由美国Cable Labs牵头组成的国际性开源协作项目,为推动HTML5技 …

Posted

archive

tg威武!假证书都来了!!!

-----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

modify or update values django.utils.datastructures.MergeDict

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 …

Posted

archive

Google Dict API

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

接触Datomic

HN上看到过好多次 Datomic,但是今天才仔细看了下。

看不到Infoq视频的可以看这里中文 Datomic的架构

so far的一些观点:

  • 这货的Datom不 …

Posted

archive

你熟悉的计算机语言是第几代的?

1GL (First-generation programming language)

机器语言 —— 就是传说中小刀刻光盘那哥们儿去美国之后发明的

2GL:

  • 汇编

3GL:

  • Fortran
  • COBOL
  • Pascal
  • C
  • C++
  • C#
  • Java
  • BASIC
  • Delphi
  • Ada

4GL:

  • LabVIEW
  • Progress 4GL (OpenEdge Advanced …

Posted

archive

圣多美的Pico Cão Grande这座山碉堡了

一座300米高,拔地而起成jj状的山。。。。。。。。。。。。名字叫 Pico Cão Grande ,人称 大狗峰

São Tomé and Príncipe 圣多美这个国家在沙哈拉以南,非洲大陆西边的一 …

Posted

archive

Google的Chrome云太混乱了

最近想做点Chrome方面的开发,发现太混乱了。整理一下逻辑吧:

Google Chrome
这个不仅是浏览器,而且是一整套生态系统体系

Google Chrome Extensions
大 …

Posted

archive

QOTD

看到这个很有趣啊

  • 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 …

Posted

archive

这段视频看得我心惊肉跳

人性人性。认知造就的人类阶级,真是震撼。

习惯了每天在网上喷来喷去,第一次见到Ms. Jane Elliott这么镇定而犀利的人。这种老 …

Posted

archive

moin moin wiki的0day,日了python.org,再日debian.org。

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 …

Posted

archive

迅雷 vod 云播放原来是django写的呀

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 …

Posted

archive

发现野生troll一只

看到这个博客《搜狐微访谈:方舟子揭露微波炉烹饪致癌谣言》

方舟子跟网友互动啦, blah blah一大堆。。看到这个问答,笑喷了。

鹏赋 …

Posted

archive

学习一句话

Life begins at the end of comfort zone.

有的时候重复一万遍的道理在另外的地方才能看懂。

via

Posted

archive