That’s what happens when you put together a bunch of Indian PM and Indian coders
trace:CustomError
at new Wza (https://plus.google.com/_/scs/apps-static/_/js/k=oz.home.en.MM2nmUD9sr4.O/m=b,s/am=AAHhGADElx2FYAJBBsgAAIAxAB-ggWQIklGAYP7_-397BHABAAAC/rt=h/d=1/rs=AItRSTN8InaGcWBwBsF5rTap5RX6vnBjtw:607:24)
at Lv.q.myb (https://plus.google.com/_/scs/apps-static/_/js/k=oz.home.en.MM2nmUD9sr4.O/m=b,s/am=AAHhGADElx2FYAJBBsgAAIAxAB-ggWQIklGAYP7_-397BHABAAAC/rt=h/d=1/rs=AItRSTN8InaGcWBwBsF5rTap5RX6vnBjtw:1794:53)
at Jda (https://plus.google.com/_/scs/apps-static/_/js/k=oz.home.en.MM2nmUD9sr4.O/m=b,s/am=AAHhGADElx2FYAJBBsgAAIAxAB-ggWQIklGAYP7_-397BHABAAAC/rt=h/d=1/rs=AItRSTN8InaGcWBwBsF5rTap5RX6vnBjtw:113:214)
at Ida (https://plus.google.com/_/scs/apps-static/_/js/k=oz.home.en.MM2nmUD9sr4.O/m=b,s/am=AAHhGADElx2FYAJBBsgAAIAxAB-ggWQIklGAYP7_-397BHABAAAC/rt=h/d=1/rs=AItRSTN8InaGcWBwBsF5rTap5RX6vnBjtw:111:221)
at ag.q.jd (https://plus.google.com/_/scs/apps-static/_/js/k=oz.home.en.MM2nmUD9sr4.O/m=b,s/am=AAHhGADElx2FYAJBBsgAAIAxAB-ggWQIklGAYP7_-397BHABAAAC/rt=h/d=1/rs=AItRSTN8InaGcWBwBsF5rTap5RX6vnBjtw:771:425)
at Jda (https://plus.google.com/_/scs/apps-static/_/js/k=oz.home.en.MM2nmUD9sr4.O/m=b,s/am=AAHhGADElx2FYAJBBsgAAIAxAB-ggWQIklGAYP7_-397BHABAAAC/rt=h/d=1/rs=AItRSTN8InaGcWBwBsF5rTap5RX6vnBjtw:113:214)
at Ida (https://plus.google.com/_/scs/apps-static/_/js/k=oz.home.en.MM2nmUD9sr4.O/m=b,s/am=AAHhGADElx2FYAJBBsgAAIAxAB-ggWQIklGAYP7_-397BHABAAAC/rt=h/d=1/rs=AItRSTN8InaGcWBwBsF5rTap5RX6vnBjtw:111:221)
at ag.q.jd (https://plus.google.com/_/scs/apps-static/_/js/k=oz.home.en.MM2nmUD9sr4.O/m=b,s/am=AAHhGADElx2FYAJBBsgAAIAxAB-ggWQIklGAYP7_-397BHABAAAC/rt=h/d=1/rs=AItRSTN8InaGcWBwBsF5rTap5RX6vnBjtw:771:425)
at https://plus.google.com/_/scs/apps-static/_/js/k=oz.home.en.MM2nmUD9sr4.O/m=b,s/am=AAHhGADElx2FYAJBBsgAAIAxAB-ggWQIklGAYP7_-397BHABAAAC/rt=h/d=1/rs=AItRSTN8InaGcWBwBsF5rTap5RX6vnBjtw:141:63
at $da.execute (https://plus.google.com/_/scs/apps-static/_/js/k=oz.home.en.MM2nmUD9sr4.O/m=b,s/am=AAHhGADElx2FYAJBBsgAAIAxAB-ggWQIklGAYP7_-397BHABAAAC/rt=h/d=1/rs=AItRSTN8InaGcWBwBsF5rTap5RX6vnBjtw:797:81)
context.location:https://plus.google.com/_/scs/apps-static/_/js/k=oz.home.en.MM2nmUD9sr4.O/m=b,s/am=AAHhGADElx2FYAJBBsgAAIAxAB-ggWQIklGAYP7_-397BHABAAAC/rt=h/d=1/rs=AItRSTN8InaGcWBwBsF5rTap5RX6vnBjtw
context.top.location:https://plus.google.com/u/0/
context.buildLabel:es_oz_20130519.13_p2
context.version:oz.home.en.MM2nmUD9sr4.O
context.historytoken_:
context.propertyId:119
context.nwTimeSinceLastLoad:140591
context.nwIsWidgetVisible:false
context.nwCurrentUnreadCount:0
context.nwNotificationTypes:2,3,16,20,24
context.call-stack:Sda(object, object, null)
Qda(object, null, object)
mg(object)
Jda(object)
Ida(object, false, object)
[Anonymous](object)
[...circular reference...]
To install
$ pip install zfec
Suppose I have two blocks of data and want a third block as redundancy
>>> zfec.Encoder(2, 3).encode(['ab', 'cd'])
['ab', 'cd', 'en']
>>> zfec.Decoder(2, 3).decode(['ab', 'cd', ], [0, 1])
['ab', 'cd']
# somehow lost the second block, use the third block the recover
>>> zfec.Decoder(2, 3).decode(['ab', 'en', ], [0, 2])
['ab', 'cd']
In the above example, k=2 and m=3
ref: https://pypi.python.org/pypi/zfec
secret = 123
a, b, c = [int((random.random() * 256)) for x in range(3)]
d = map(xor, [secret, a, b, c])
so 4 players has each a share of secret.
This is kinda lame… Shamir’s scheme is much better
Suppose you have the following model:
class MyModel(models.Model):
def get_absolute_url(self, *args, **kwargs):
return '/show/%s' % self.pk
The “View on site” button on admin will always take you to example.com, which is bullshit.
Even if you override it with ABSOLUTE_URL_OVERRIDES in settings.py.
The solution is to fuck Django’s default Site in your models.py:
from django.contrib.sites import models as SiteModels
SiteModels.Site._meta.installed = False
下边的问题是在CPython interactive shell 里按顺序执行的,请在 下划线处 ____ 填上答案。
>>> x = [1, 2, 3]
>>> for number in x:
... number += 1
...
>>> print x
__________________
>>> print 1 == True
__________________
>>> print 0 == False
__________________
>>> print 2 == True
__________________
>>> item = 'x'
>>> print item == "y" or "z"
___________________
>>> l = [1,6,4,2,3,9,4,6]
>>> l = l.sort()
>>> print l
___________________
>>> ll = [lambda: n for n in range(5)]
>>> print [l() for l in ll]
___________________
>>> my_gen = (i for i in range(10))
>>> print(3 in my_gen)
___________________
>>> print(7 in my_gen)
___________________
>>> print(2 in my_gen)
___________________
最近HN上有个关于Linux 3.1内核tickless新特性的讨论,然后一位微软员工,自称来自NT内核组,发个帖子抱怨微软:
See, component owners are generally openly hostile to outside patches: if you’re a dev, accepting an outside patch makes your lead angry (due to the need to maintain this patch and to justify in in shiproom the unplanned design change), makes test angry (because test is on the hook for making sure the change doesn’t break anything, and you just made work for them), and PM is angry (due to the schedule implications of code churn). There’s just no incentive to accept changes from outside your own team. You can always find a reason to say “no”, and you have very little incentive to say “yes”.
Another reason for the quality gap is that that we’ve been having trouble keeping talented people. Google and other large Seattle-area companies keep poaching our best, most experienced developers,
More examples:
- We can’t touch named pipes. Let’s add %INTERNAL_NOTIFICATION_SYSTEM%! (Oh, and let’s make %INTERNAL_NOTIFICATION_SYSTEM% inconsistent with virtually every other named NT primitive.)
- We can’t expose %INTERNAL_NOTIFICATION_SYSTEM% to the rest of the world because we don’t want to fill out paperwork and we’re not losing sales because we only have 1990s-era Win32 APIs available publicly.
- We can’t touch DCOM. Let’s create %C#_REMOTING_FLAVOR_OF_THE_WEEK%!
- XNA. Need I say more?
- Why would anyone need an archive format that supports files larger than 2GB?
- Let’s support symbolic links (Can I have a one on my review score now?), but make sure that nobody can use them so I don’t get blamed for security vulnerabilities (Great! I got that one on my review score, and now I get to look sage and responsible!)
- We can’t touch Source Depot, so let’s hack together SDX!
- We can’t touch SDX, so let’s pretend for four releases that we’re moving to TFS while not actually changing anything!
- Oh god, the NTFS code is a purple opium-fueled Victorian horror novel that uses global recursive locks and SEH for flow control. Let’s write ReFs instead. (And hey, let’s start by copying and pasting the NTFS source code and removing half the features! Then let’s add checksums, because checksums are cool, right, and now with checksums we’re just as good as ZFS? Right? Do I get a one on my review score now? And who the hell needs quotas anyway?)
- We just can’t be fucked to implement C11 support, and variadic templates were just too hard to implement in a year. (But ohmygosh I turned “^” into a reference-counted pointer operator. Can I have my patent cube and one on my review score now? Oh, and what’s a reference cycle?)
简单的说,就是NT内核
在大学的时候也接触过微软技术体系,感觉是有牛逼的地方,有亮点,但是偶数代会把奇数代的技术否定掉。记得有个哥们花了很大力气学习翻译了.NET Atlas AJAX,结果beta一完毕,整个AJAX体系就变得面目全非了。
微软的内部已经死掉了。Wintel 没有希望了。PC也将继续没落。
btw 想起了一幅图

看到这个demo:n-Body Choreographies v. 0.9
js写的太看了。赞一个。
其中很多模型我觉得比较好理解啊:
比如:
D(10,8/3) 这个可以看成两个质心互绕,其中每个质心就是5个球体。。。
D(10,5/2) 这个可以看成2个质心一个收缩一个膨胀
D(8,9/4) 也类似2个质心。。。
很多看似复杂的轨道把 trajectory 关了就发现简单规律了。人脑的模式识别真是个神奇的东西~~~~~~~~~~~~~~
让我想起了几天前fallark发的那个分解质因数的javascript
都是超赞的东西~
Steiner tree problem 好酷!的解法!中间的点叫做 费马点
简单的例子,来自官网
python的查询代码:
select(c for c in Customer
if sum(c.orders.price) > 1000)
通过PonyORM翻译成SQL:
SELECT "c"."id"
FROM "Customer" "c"
LEFT JOIN "Order" "order-1"
ON "c"."id" = "order-1"."customer"
GROUP BY "c"."id"
HAVING coalesce(SUM("order-1"."total_price"), 0) > 1000
以前觉得peewee的查询语法很clever,比Django那种丑爆的 price__gt=1000 好出一条街。那么PonyORM就超出其他python ORM一条银河系了。
这个PonyORM的黑魔法在哪里呢?
select(x for x in ...) 这是一个generator comprehension,和list comprehension不同的是,返回的是一个惰性求值的生成器,于是出自PonyORM开发者 u/amalashkevich。更加详细的黑魔法解释可以在stackoverflow上看到。
可以说Peewee和PonyORM的设计才是优雅的。但是PonyORM更加高级,基本接近了LINQ和超过了Hibernate HQL。
顺便提一下,有一个另外类似的ORM——PQL,用于MongoDB:
比如:
pql.find("a > 1 and b == 'foo' or not c.d == False")
翻译成MongoDB的查询:
{'$or': [{'$and': [{'a': {'$gt': 1}}, {'b': 'foo'}]}, {'$not': {'c.d': False}}]}
很可惜它是基于字符串的翻译,而不是原生python表达式。
其他讨论
码农的定义就不用说了。
码畜的定义:
> If you answer to managers and build CRUD apps to support their careers rather than your own, then you’re not a professional.
如果你的职业生涯就是给你的上级写CRUD应用。那么你就是码畜。
话说E.164这个标准还是挺重要的。电话国家区号。比如中国是 +86
好吧。我们去看下官网:
http://www.itu.int/itudoc/itu-t/ob-lists/icc/e164_763.html
卧槽,哪里可以下载???????
查看源码——有pdf和doc下载。。。。。但是页面上没有????
用F12开发者工具一看,卧槽,尼玛居然需要水平滚动,下载icon在页面最右边!!!!!!!body的水平width是1910px!!!!!!我了个大艹!!!!!!

尼玛水平滚动也就算了,footer文字为毛position根据窗口固定?
好了。下载pdf ,一打开:

尼玛逼的,怎么搞技术的都这么脑残,不懂 natural sort 呢?
后来发现为啥不用natural sort了。这尼玛坑爹的国家区号是变长的。
+123 123456
+12 3123456
可能是两个来自两个国家的不同号码,这个没法区分。
怎么办?ITU这帮聪明人想了个办法:
比如 0 - 9 个位数区号,只有 +1北美 和+7毛熊。
然后没有1或7开头的二位数、三位数区号。
这设计让人泪流满面!!!!让我想起了牛逼的兲朝IPv9网络。
tg还曾经让 ITU 这个婊子去把网络审查标准国际化。