HNHacker News
TopNewBestAskShowJobs

davidhollander

996 karma · joined December 11, 2010

.
submissionscomments
davidhollander··on Thousands of Threads and Blocking I/O [pdf]
Eh, I would just limit the front process to coroutines accepting incoming connections and accepting complete responses from remote procedure calls and use neither threads nor polling. Launch a lot of worker processes to divide and conquer all the actual work, restart some on the other end of a TCP/IP connection if scaling is necessary. But that's my preference.
davidhollander··on Writing Python 2.x forward compatible to Python 3 code
For web development in Py3k the big holdback has been PEP3333, but it recently stabilized this month which is great news! http://www.python.org/dev/peps/pep-3333/

Also be aware of the following:

There is currently no memcached library for Py3k. https://github.com/lericson/pylibmc/issues#issue/21

[edit: If you use the uWSGI appserver with nginx or cherokee to deploy, I believe it will have cacheing for Py3k in its .97 release next month]

One of the problems is python.org has been emphasizing a Python2to3 without a Python3to2 converter. The ideal situation would be library, framework and module developers write in Python 3 and release a compatibility Python2 version via an automated converter, rather than the other way around. Otherwise they will be forced to do primary development in Python2 and not have the resources to maintain a separate Py3 branch.

Link to Python3to2 repository: https://bitbucket.org/amentajo/lib3to2/

davidhollander··on A world without advertising
Baker A: lives in a cave and consumes zero information

Baker B: actively pulls in information about surroundings

If the product you introduce actually generates substantial value for bakers, then Baker A will be forced out of the market by Baker B. In the very unlikely event the entire market of bakers is type A, then you launch your own bakery and make a killing. In the unlikely event there are plenty of type B Bakers but none of them have started an information pull source, then you launch your own information pull source and make a killing.

davidhollander··on L-Theanine: a 4,000 Year Old Mind-Hack
Sencha and its variants will have the highest

http://en.wikipedia.org/wiki/Sencha

only chart I could find: http://www.o-cha.com/green-tea-benefits.htm

I'm able to buy loose leaf in bulk from a local store so I can't recommend a particular online retailer. In person I would go by smell rather than brand, the aroma of good sencha is very distinct.

davidhollander··on Lua Coroutines vs. Python Generators
It seems Lua is the better choice for writing an asynchronous web micro-framework. I spent a lot of time trying to write a super minimal WSGI website in Python using nested generators and then realized I was wasting my time if I couldn't yield back to the body content iterator from anywhere in the call stack. uWSGI has an nginx plugin and support for Lua wsapi if anyone is interested: http://projects.unbit.it/uwsgi/wiki/Lua
davidhollander··on RIP Bill Zeller
I respect your disagreement. I see how grouping abuse with other forms of post-traumatic stress could be viewed insensitive to the personal suffering of Mr. Zeller. However, from a psychological perspective, Post Traumatic Stress Disorder in all forms is associated with the recurring visions, nightmares, avoidance of treatment, and extreme cumulative pain he refers to. I justify and stand by the timing of my comment using the principle of harm reduction. Whenever painful incidents occur that challenge us very deeply psychologically, the world would be a better place if we all stopped and thought about how we contribute to that pattern of suffering... rather than brushing it under the cognitive rug to "think about later". Because usually we never will.
davidhollander··on RIP Bill Zeller
From reading the letter you can tell he was suffering extremely from Post Traumatic Stress Disorder throughout much of his life.

I did not feel sad as much as disgusted that, through our politicians, we have:

A) made illegal the most effective treatment for Post Traumatic Stress Disorder : MDMA

B) continue to support the primary generator of new PTSD cases: war

If you want to do something other than sit around feeling sad for a while, help address one of the above problems and prevent the situation from happening again.

[further reading]

http://www.timesonline.co.uk/tol/life_and_style/health/artic...

>Ecstasy is the key to treating PTSD At last the incurably traumatised may be seeing the light at the end of the tunnel. And controversially, the key to taming their demons is the ‘killer’ drug Ecstasy

http://www.maps.org/research/mdma/

>For-profit pharmaceutical companies are not interested in developing MDMA into a medicine, because the patent for MDMA has expired. Companies cannot profit off of MDMA because it is only administered a limited number of times, unlike most medications for mental illnesses that are taken on a daily basis. Consequently MAPS is the only organization funding clinical trials of MDMA-assisted psychotherapy in the world

http://www.msnbc.msn.com/id/5334479/ns/health-mental_health/

>1 in 8 returning soldiers suffers from PTSD But less than half with problems seek help, report finds

davidhollander··on Minimalism is not a viable intellectual strategy
>My gripe is with the way they sell it as a way of life.

I think it is fair to classify minimalism as a way of life, because simplification heuristics are intrinsically broad in scope. In other words, it is not possible for minimalism to not be a way of life, because adding information to specify the domain to which minimalism applies would be decidedly unminimalistic.

If anyone is interested in real debate on this topic simply read the wiki on Occam's Razor: http://en.wikipedia.org/wiki/Occams_razor

I generally find myself in support of Einstein's Constraint:

>Everything should be kept as simple as possible, but no simpler.

davidhollander··on Common Mistakes as Python Web Developer
Good advice for problems, but one should focus more on the underlying problem mentioned:

chances are, vital files can be accessed with the rights your application has.

When you deploy your webapp, NEVER run your web server or application container server as root. I deploy python using nginx and uWSGI where nginx runs as the "nginx" user and group, and uwsgi runs as the "uwsgi" user and group.

Since uWSGI is spawning all the python instances, if I want to be able access files on disk such as for storing and reading sessions, I must explicitly change the folder owner to the uwsgi group for the webapp to even launch.

If you take only one security precaution for your production python app, make sure none of the instantiating servers run as root and that they must be given explicit permission to access folders.

davidhollander··on Ray Kurzweil: How My Predictions Are Faring (2010)
Ray is systematically restating his opinions in much more vague manner than his original publication of the Singularity is Near.

Originally:

"By the end of this decade, computers will disappear as distinct physical objects, with displays built in our eyeglasses, and electronics woven in our clothing, providing full-immersion visual virtual reality."

Now (from the PDF):

"Personal computers are available in a wide range of sizes and shapes"..."the prediction does not say that all computers would be small devices integrated in these ways, just that this would be common, which is indeed the case"

Sorry Ray, I'm not convinced.

I believe Ray completely ignores economics in his predictions. Things such as Moore's law appear when there is always constant, high economic demand. There is always constant, high economic demand for faster computers due to the intrinsic nature of how computers are used. There is NOT constant, high demand for new consumer technologies that haven't been developed and extensively marketed yet.

A corrollary is tablet computers. Development and research into touch interfaces did not increase exponentially after it was developed. Rather, you had to wait 9 years for an Apple to come along to do the hardwork of changing consumer preference to create the economic demand for this improved human-computer interface.

Ray usually seems to assume that an AI is in charge of the economic demand leading to its creation before it is created. He ignores the "stickiness" inherent in consumer demand. Perhaps there is a place for the post-service economy techno-marxist cyber utopia he envisions, but I don't see it occurring before capitalism has run its course globally, which will still take some time.

davidhollander··on Ask HN: Would You Ever Pay For Search?
> a major technological hurdle

I don't think it's a technological hurdle at all, scraping websites is fairly standard nowadays. The challenge is a logical one. You just need to mentally think up of a better logical algorithm than Page Rank.

Page Rank is a very robust heuristic with many perhaps unwitting parallels to social psychology. How people gain status in groups and social norms are created is similar to how websites rank. Perhaps you could catch up on social psychology theory or other seemingly unrelated fields to see if any sparks fly about how you could apply it to the web.

davidhollander··on Ask HN: Would You Ever Pay For Search?
Well it's a completely different cognitive heuristic. Duck Duck Go the heuristic is continuous rapid scanning. For Google: send, receive, digest.

I believe the brain tends to only evaluate around 7+/-2 ( http://en.wikipedia.org/wiki/The_Magical_Number_Seven,_Plus_... ) chunks at a time for each comparison anyway so I prefer the minimalism of Duck Duck Go. Which displays 7-9 results in my visual field at the default zoom level. But I agree my original claims were perhaps a bit hyperbolic and there is definitely a role for consumer preference in the search engine market.

I think perhaps we can agree Google is perhaps a bit too rigid in only offering it's single namesake search prompt and should provide further variations of its core product to cater to a variety of heuristics for visual processing of information.

davidhollander··on Ask HN: Would You Ever Pay For Search?
> for search that was significantly better than google

Why aren't you using Duck Duck Go? [ http://duckduckgo.com/ ]

It's 10 times faster than Google to find stuff if you're a programmer, you can just press J, K like it was VIM and just focus your eyes on the green box to scan like 100 webpages instantly.

It's even faster if you don't use Chromium but a browser with a sane and configurable BACK button (ex. Opera ex. BACKSPACE) instead of moveyour-hand + ALT + ARROW nonsense.

Set homepage to DuckDuckGo and just press backspace with pinky to get back to entering a new search. IMO even if you want to end up at a google service like Google News it's faster, ex. "!news wikileaks"

davidhollander··on Python as an Alternative to Lisp or Java, Peter Norvig revisited
For the most EXTREME algorithmic compression of information to number of lines in Python (with few to 0 intermediate values stored), I've found it hard to beat using nested function definitions with abstracted shared logic called by running the vars() builtin as the parameter list. Basically ship the current scope elsewhere to finish processing to ensure no logic is repeated.

I tend to not use separate URL mappers in controllers but have nested functions that define both logic and layout simultaneously. (Basically a tree structure of function definitions where the ending subpage elements are leaf nodes, and nodes render wrapper base templates on post traversal unless it was an ajax request). I can post some code if this doesn't make sense. Obviously not defining new variables nor using classes is extremely unpythonic and could pose difficulties for group work... minimum number of lines while fun isn't everything!

← PreviousPage 8 of 8