サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
災害への備え
emptysqua.re
Wikimedia commons Yesterday we released the latest unstable version of MongoDB; the headline feature is basic full-text search. You can read all about MongoDB's full text search in the release notes. This blog had been using a really terrible method for search, involving regular expressions, a full collection scan for every search, and no ranking of results by relevance. I wanted to replace all th
I wrote the other day about two things I think are weird about Python's += operator. In the comments, famed Twisted hacker Jean-Paul Calderone showed me something far, far weirder. This post is a record of me playing around and trying to understand it. To begin let's review what we know. Tuples are immutable in Python, so you can't increment a member of a tuple: >>> x = (0,) >>> x (0,) >>> x[0] +=
Courtesy The Beinecke Library How do you create the best index for a complex MongoDB query? I'll present a method specifically for queries that combine equality tests, sorts, and range filters, and demonstrate the best order for fields in a compound index. We'll look at the explain() output to see exactly how well it performs, and we'll see how the MongoDB query-optimizer selects an index. Content
The Weirdness What do you think this script prints?: import thread, threading, sys class Weeper(object): def del(self): sys.stdout.write('oh cruel world %s\n' % thread.get_ident()) local = threading.local() def target(): local.weeper = Weeper() t = threading.Thread(target=target) t.start() t.join() sys.stdout.write('done %s\n' % thread.get_ident()) getattr(local, 'whatever', None)
このページを最初にブックマークしてみませんか?
『emptysqua.re』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く