Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
mborch
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
16 ms
·
121.
▲
by
mborch
12y ago
While definitely superfluous, it arguably makes it easier to read and scan.
122.
▲
by
mborch
12y ago
>>> from pprint import pprint; pprint(list_of_tuples)
123.
▲
by
mborch
12y ago
I think this is intentional. Django's manage command is already extensible, so if you're using Django then perhaps it's best to use its tool chain.
124.
▲
by
mborch
12y ago
I would count lengths and offsets with respect to characters (codepoints). Note that for fixed-length encodings such as "raw", "ascii", or "latin-1", this always means bytes.
125.
▲
by
mborch
12y ago
I think HTTP request and response headers make a great example. You read a raw stream of bytes line by line (8-bit fixed), and split on newlines. In this protocol we know that each string is "latin-1", so we can extract and decode
126.
▲
by
mborch
12y ago
I can see how that could be a useful optimization for nodes already in UTF-8, but in my scheme, the rope would have to accommodate fixed-width codecs such as "raw" and "latin-1", too. For instance, if you read bytes from
127.
▲
by
mborch
12y ago
The Zen of Python claims "There should be one-- and preferably only one --obvious way to do it." I think multiple string types go against that. It is the simplicity that makes it practical; not an argument of purity in my opinion.
128.
▲
Python's missing string type
(maltheborch.com)
10 points
by
mborch
12y ago
|
9 comments
129.
▲
by
mborch
13y ago
He means that it's a wormhole that you can't get yourself out of, initially because you're too invested to give it up, and going forward, because it's become a part of the application and as such, can't be taken out
130.
▲
by
mborch
13y ago
You could use mutex locking on the file system to avoid the race conditions.
131.
▲
by
mborch
13y ago
Celery is typically used with RabbitMQ, which is an advanced message broker. If you don't need the complexity (most don't), need persistence, transactional guarantees and already have PostgreSQL in your stack, then the pq-library
132.
▲
by
mborch
13y ago
With PostgreSQL, you can use advisory locks and other little tricks to get better performance, e.g. https://github.com/malthe/pq/blob/master/pq/__init__.py#L224
133.
▲
by
mborch
13y ago
I wrote https://pypi.python.org/pypi/pq , a transactional task queue for PostgreSQL, depends only on psycopg2. It does about 1000 ops per second, depending on your database configuration, network etc.
134.
▲
by
mborch
13y ago
They're based in Nairobi and they run a technology innovations lab there.
135.
▲
PQ is a transactional queue for PostgreSQL in Python
(pypi.python.org)
4 points
by
mborch
13y ago
|
0 comments
136.
▲
Protobufs ported to Python 3
(maltheborch.com)
3 points
by
mborch
14y ago
|
0 comments
137.
▲
by
mborch
14y ago
There isn't much more to it. As said in another comment, it's a "classical transfer pricing case". Google Translate doesn't do a very good job though: > Neither Honey, Microsoft or the IRS IRS wants to comment on the pending tax to DR2.
138.
▲
Hogging all cores with Python
(maltheborch.com)
4 points
by
mborch
14y ago
|
0 comments